Add tests checking if no depth is written when depth test is disabled
authorSlawomir Cygan <slawomir.cygan@intel.com>
Fri, 18 Jan 2019 15:27:10 +0000 (16:27 +0100)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Fri, 8 Feb 2019 12:57:41 +0000 (07:57 -0500)
This adds depth buffer verification to all dEQP-VK.pipeline.depth tests.

Moreover new tests are added, checking if depth buffer is not modified,
when depth test is disabled (while depth write is enabled).

Components: Vulkan

VK-GL-CTS Issue: 1568

Affects: dEQP-VK.pipeline.depth.*

New Tests: dEQP-VK.pipeline.depth.format.*.depth_test_disabled.depth_write_enabled

Change-Id: I5b496ef5a2b89b47fa254a9400bd6c985323c10a

android/cts/master/vk-master.txt
external/vulkancts/modules/vulkan/pipeline/vktPipelineDepthTests.cpp
external/vulkancts/modules/vulkan/pipeline/vktPipelineImageUtil.cpp
external/vulkancts/modules/vulkan/pipeline/vktPipelineImageUtil.hpp
external/vulkancts/modules/vulkan/pipeline/vktPipelineReferenceRenderer.cpp
external/vulkancts/modules/vulkan/pipeline/vktPipelineReferenceRenderer.hpp
external/vulkancts/mustpass/1.1.4/vk-default-no-waivers.txt
external/vulkancts/mustpass/1.1.4/vk-default.txt

index 875a913..89e1820 100755 (executable)
@@ -111448,6 +111448,7 @@ dEQP-VK.pipeline.depth.format.d16_unorm.compare_ops.not_equal_not_equal_greater_
 dEQP-VK.pipeline.depth.format.d16_unorm.compare_ops.not_equal_less_or_equal_not_equal_greater
 dEQP-VK.pipeline.depth.format.d16_unorm.compare_ops.not_equal_less_or_equal_not_equal_greater_depth_bounds_test
 dEQP-VK.pipeline.depth.format.d16_unorm.compare_ops.never_zerodepthbounds_depthdisabled_stencilenabled
+dEQP-VK.pipeline.depth.format.d16_unorm.depth_test_disabled.depth_write_enabled
 dEQP-VK.pipeline.depth.format.x8_d24_unorm_pack32.compare_ops.not_equal_not_equal_not_equal_not_equal
 dEQP-VK.pipeline.depth.format.x8_d24_unorm_pack32.compare_ops.not_equal_not_equal_not_equal_not_equal_depth_bounds_test
 dEQP-VK.pipeline.depth.format.x8_d24_unorm_pack32.compare_ops.not_equal_equal_equal_greater
@@ -111597,6 +111598,7 @@ dEQP-VK.pipeline.depth.format.x8_d24_unorm_pack32.compare_ops.not_equal_not_equa
 dEQP-VK.pipeline.depth.format.x8_d24_unorm_pack32.compare_ops.not_equal_less_or_equal_not_equal_greater
 dEQP-VK.pipeline.depth.format.x8_d24_unorm_pack32.compare_ops.not_equal_less_or_equal_not_equal_greater_depth_bounds_test
 dEQP-VK.pipeline.depth.format.x8_d24_unorm_pack32.compare_ops.never_zerodepthbounds_depthdisabled_stencilenabled
+dEQP-VK.pipeline.depth.format.x8_d24_unorm_pack32.depth_test_disabled.depth_write_enabled
 dEQP-VK.pipeline.depth.format.d32_sfloat.compare_ops.not_equal_not_equal_not_equal_not_equal
 dEQP-VK.pipeline.depth.format.d32_sfloat.compare_ops.not_equal_not_equal_not_equal_not_equal_depth_bounds_test
 dEQP-VK.pipeline.depth.format.d32_sfloat.compare_ops.not_equal_equal_equal_greater
@@ -111746,6 +111748,7 @@ dEQP-VK.pipeline.depth.format.d32_sfloat.compare_ops.not_equal_not_equal_greater
 dEQP-VK.pipeline.depth.format.d32_sfloat.compare_ops.not_equal_less_or_equal_not_equal_greater
 dEQP-VK.pipeline.depth.format.d32_sfloat.compare_ops.not_equal_less_or_equal_not_equal_greater_depth_bounds_test
 dEQP-VK.pipeline.depth.format.d32_sfloat.compare_ops.never_zerodepthbounds_depthdisabled_stencilenabled
+dEQP-VK.pipeline.depth.format.d32_sfloat.depth_test_disabled.depth_write_enabled
 dEQP-VK.pipeline.depth.format.d16_unorm_s8_uint.compare_ops.not_equal_not_equal_not_equal_not_equal
 dEQP-VK.pipeline.depth.format.d16_unorm_s8_uint.compare_ops.not_equal_not_equal_not_equal_not_equal_depth_bounds_test
 dEQP-VK.pipeline.depth.format.d16_unorm_s8_uint.compare_ops.not_equal_equal_equal_greater
@@ -111895,6 +111898,7 @@ dEQP-VK.pipeline.depth.format.d16_unorm_s8_uint.compare_ops.not_equal_not_equal_
 dEQP-VK.pipeline.depth.format.d16_unorm_s8_uint.compare_ops.not_equal_less_or_equal_not_equal_greater
 dEQP-VK.pipeline.depth.format.d16_unorm_s8_uint.compare_ops.not_equal_less_or_equal_not_equal_greater_depth_bounds_test
 dEQP-VK.pipeline.depth.format.d16_unorm_s8_uint.compare_ops.never_zerodepthbounds_depthdisabled_stencilenabled
+dEQP-VK.pipeline.depth.format.d16_unorm_s8_uint.depth_test_disabled.depth_write_enabled
 dEQP-VK.pipeline.depth.format.d24_unorm_s8_uint.compare_ops.not_equal_not_equal_not_equal_not_equal
 dEQP-VK.pipeline.depth.format.d24_unorm_s8_uint.compare_ops.not_equal_not_equal_not_equal_not_equal_depth_bounds_test
 dEQP-VK.pipeline.depth.format.d24_unorm_s8_uint.compare_ops.not_equal_equal_equal_greater
@@ -112044,6 +112048,7 @@ dEQP-VK.pipeline.depth.format.d24_unorm_s8_uint.compare_ops.not_equal_not_equal_
 dEQP-VK.pipeline.depth.format.d24_unorm_s8_uint.compare_ops.not_equal_less_or_equal_not_equal_greater
 dEQP-VK.pipeline.depth.format.d24_unorm_s8_uint.compare_ops.not_equal_less_or_equal_not_equal_greater_depth_bounds_test
 dEQP-VK.pipeline.depth.format.d24_unorm_s8_uint.compare_ops.never_zerodepthbounds_depthdisabled_stencilenabled
+dEQP-VK.pipeline.depth.format.d24_unorm_s8_uint.depth_test_disabled.depth_write_enabled
 dEQP-VK.pipeline.depth.format.d32_sfloat_s8_uint.compare_ops.not_equal_not_equal_not_equal_not_equal
 dEQP-VK.pipeline.depth.format.d32_sfloat_s8_uint.compare_ops.not_equal_not_equal_not_equal_not_equal_depth_bounds_test
 dEQP-VK.pipeline.depth.format.d32_sfloat_s8_uint.compare_ops.not_equal_equal_equal_greater
@@ -112193,6 +112198,7 @@ dEQP-VK.pipeline.depth.format.d32_sfloat_s8_uint.compare_ops.not_equal_not_equal
 dEQP-VK.pipeline.depth.format.d32_sfloat_s8_uint.compare_ops.not_equal_less_or_equal_not_equal_greater
 dEQP-VK.pipeline.depth.format.d32_sfloat_s8_uint.compare_ops.not_equal_less_or_equal_not_equal_greater_depth_bounds_test
 dEQP-VK.pipeline.depth.format.d32_sfloat_s8_uint.compare_ops.never_zerodepthbounds_depthdisabled_stencilenabled
+dEQP-VK.pipeline.depth.format.d32_sfloat_s8_uint.depth_test_disabled.depth_write_enabled
 dEQP-VK.pipeline.dynamic_offset.graphics.uniform_buffer.numcmdbuffers_1.sameorder.numdescriptorsetbindings_1.numdynamicbindings_1.numnondynamicbindings_0
 dEQP-VK.pipeline.dynamic_offset.graphics.uniform_buffer.numcmdbuffers_1.sameorder.numdescriptorsetbindings_1.numdynamicbindings_1.numnondynamicbindings_1
 dEQP-VK.pipeline.dynamic_offset.graphics.uniform_buffer.numcmdbuffers_1.sameorder.numdescriptorsetbindings_1.numdynamicbindings_2.numnondynamicbindings_0
index 2f24cab..edd4df9 100644 (file)
@@ -328,7 +328,8 @@ DepthTestInstance::DepthTestInstance (Context&                              context,
                        1u,                                                                                             // deUint32                                     arrayLayers;
                        VK_SAMPLE_COUNT_1_BIT,                                                  // VkSampleCountFlagBits        samples;
                        VK_IMAGE_TILING_OPTIMAL,                                                // VkImageTiling                        tiling;
-                       VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT,    // VkImageUsageFlags            usage;
+                       VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT |
+                       VK_IMAGE_USAGE_TRANSFER_SRC_BIT,                                // VkImageUsageFlags            usage;
                        VK_SHARING_MODE_EXCLUSIVE,                                              // VkSharingMode                        sharingMode;
                        1u,                                                                                             // deUint32                                     queueFamilyIndexCount;
                        &queueFamilyIndex,                                                              // const deUint32*                      pQueueFamilyIndices;
@@ -381,7 +382,7 @@ DepthTestInstance::DepthTestInstance (Context&                              context,
        }
 
        // Create render pass
-       m_renderPass = makeRenderPass(vk, vkDevice, m_colorFormat, m_depthFormat);
+       m_renderPass = makeRenderPass(vk, vkDevice, m_colorFormat, m_depthFormat, VK_ATTACHMENT_LOAD_OP_CLEAR, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL);
 
        // Create framebuffer
        {
@@ -651,7 +652,7 @@ tcu::TestStatus DepthTestInstance::verifyImage (void)
                {
                        // Set depth state
                        rr::RenderState renderState(refRenderer.getViewportState());
-                       renderState.fragOps.depthTestEnabled = true;
+                       renderState.fragOps.depthTestEnabled = m_depthTestEnable;
                        renderState.fragOps.depthFunc = mapVkCompareOp(m_depthCompareOps[quadNdx]);
                        if (m_depthBoundsTestEnable)
                        {
@@ -667,7 +668,7 @@ tcu::TestStatus DepthTestInstance::verifyImage (void)
                }
        }
 
-       // Compare result with reference image
+       // Compare color result with reference image
        {
                const DeviceInterface&                  vk                                      = m_context.getDeviceInterface();
                const VkDevice                                  vkDevice                        = m_context.getDevice();
@@ -687,6 +688,64 @@ tcu::TestStatus DepthTestInstance::verifyImage (void)
                                                                                                                          tcu::COMPARE_LOG_RESULT);
        }
 
+       // Compare depth result with reference image
+       {
+               const DeviceInterface&                  vk                                      = m_context.getDeviceInterface();
+               const VkDevice                                  vkDevice                        = m_context.getDevice();
+               const VkQueue                                   queue                           = m_context.getUniversalQueue();
+               const deUint32                                  queueFamilyIndex        = m_context.getUniversalQueueFamilyIndex();
+               SimpleAllocator                                 allocator                       (vk, vkDevice, getPhysicalDeviceMemoryProperties(m_context.getInstanceInterface(), m_context.getPhysicalDevice()));
+               de::MovePtr<tcu::TextureLevel>  result                          = readDepthAttachment(vk, vkDevice, queue, queueFamilyIndex, allocator, *m_depthImage, m_depthFormat, m_renderSize);
+
+
+               {
+                       de::MovePtr<tcu::TextureLevel>  convertedReferenceLevel;
+                       tcu::Maybe<tcu::TextureFormat>  convertedFormat;
+
+                       if (refRenderer.getDepthAccess().getFormat().type == tcu::TextureFormat::UNSIGNED_INT_24_8_REV)
+                       {
+                               convertedFormat = tcu::TextureFormat(tcu::TextureFormat::D, tcu::TextureFormat::UNORM_INT24);
+                       }
+                       if (refRenderer.getDepthAccess().getFormat().type == tcu::TextureFormat::UNSIGNED_INT_16_8_8)
+                       {
+                               convertedFormat = tcu::TextureFormat(tcu::TextureFormat::D, tcu::TextureFormat::UNORM_INT16);
+                       }
+                       else if (refRenderer.getDepthAccess().getFormat().type == tcu::TextureFormat::FLOAT_UNSIGNED_INT_24_8_REV)
+                       {
+                               convertedFormat = tcu::TextureFormat(tcu::TextureFormat::D, tcu::TextureFormat::FLOAT);
+                       }
+
+                       if (convertedFormat)
+                       {
+                               convertedReferenceLevel = de::MovePtr<tcu::TextureLevel>(new tcu::TextureLevel(*convertedFormat, refRenderer.getDepthAccess().getSize().x(), refRenderer.getDepthAccess().getSize().y()));
+                               tcu::copy(convertedReferenceLevel->getAccess(), refRenderer.getDepthAccess());
+                       }
+
+                       float depthThreshold = 0.0f;
+
+                       if (tcu::getTextureChannelClass(result->getFormat().type) == tcu::TEXTURECHANNELCLASS_UNSIGNED_FIXED_POINT)
+                       {
+                               const tcu::IVec4        formatBits = tcu::getTextureFormatBitDepth(result->getFormat());
+                               depthThreshold = 1.0f / static_cast<float>((1 << formatBits[0]) - 1);
+                       }
+                       else if (tcu::getTextureChannelClass(result->getFormat().type) == tcu::TEXTURECHANNELCLASS_FLOATING_POINT)
+                       {
+
+                               depthThreshold = 0.0000001f;
+                       }
+                       else
+                               TCU_FAIL("unrecognized format type class");
+
+                       compareOk = tcu::floatThresholdCompare(m_context.getTestContext().getLog(),
+                                                                                                  "DepthImageCompare",
+                                                                                                  "Depth image comparison",
+                                                                                                  convertedReferenceLevel ? convertedReferenceLevel->getAccess() : refRenderer.getDepthAccess(),
+                                                                                                  result->getAccess(),
+                                                                                                  tcu::Vec4(depthThreshold, 0.0f, 0.0f, 0.0f),
+                                                                                                  tcu::COMPARE_LOG_RESULT);
+               }
+       }
+
        if (compareOk)
                return tcu::TestStatus::pass("Result image matches reference");
        else
@@ -907,6 +966,23 @@ tcu::TestCaseGroup* createDepthTests (tcu::TestContext& testCtx)
                                                                                                                true));
                        }
                        formatTest->addChild(compareOpsTests.release());
+
+                       // Test case with depth test enabled, but depth write disabled
+                       de::MovePtr<tcu::TestCaseGroup> depthTestDisabled(new tcu::TestCaseGroup(testCtx, "depth_test_disabled", "Test for disabled depth test"));
+                       {
+                               const VkCompareOp depthOpsDepthTestDisabled[DepthTest::QUAD_COUNT] = { VK_COMPARE_OP_NEVER, VK_COMPARE_OP_LESS, VK_COMPARE_OP_GREATER, VK_COMPARE_OP_ALWAYS };
+                               depthTestDisabled->addChild(new DepthTest(testCtx,
+                                                                                                               "depth_write_enabled",
+                                                                                                               "Depth writes should not occur if depth test is disabled",
+                                                                                                               depthFormats[formatNdx],
+                                                                                                               depthOpsDepthTestDisabled,
+                                                                                                               false,                  /* depthBoundsTestEnable */
+                                                                                                               0.0f,                   /* depthBoundMin*/
+                                                                                                               1.0f,                   /* depthBoundMax*/
+                                                                                                               false,                  /* depthTestEnable */
+                                                                                                               false                   /* stencilTestEnable */));
+                       }
+                       formatTest->addChild(depthTestDisabled.release());
                        formatTests->addChild(formatTest.release());
                }
                depthTests->addChild(formatTests.release());
index 5755df5..c1157e7 100644 (file)
@@ -28,6 +28,7 @@
 #include "vkQueryUtil.hpp"
 #include "vkRefUtil.hpp"
 #include "vkCmdUtil.hpp"
+#include "vkTypeUtil.hpp"
 #include "tcuTextureUtil.hpp"
 #include "tcuAstcUtil.hpp"
 #include "deRandom.hpp"
@@ -275,6 +276,121 @@ de::MovePtr<tcu::TextureLevel> readColorAttachment (const vk::DeviceInterface&    v
        return resultLevel;
 }
 
+de::MovePtr<tcu::TextureLevel> readDepthAttachment (const vk::DeviceInterface& vk,
+                                                                                                       vk::VkDevice                            device,
+                                                                                                       vk::VkQueue                                     queue,
+                                                                                                       deUint32                                        queueFamilyIndex,
+                                                                                                       vk::Allocator&                          allocator,
+                                                                                                       vk::VkImage                                     image,
+                                                                                                       vk::VkFormat                            format,
+                                                                                                       const tcu::UVec2&                       renderSize)
+{
+       Move<VkBuffer>                                  buffer;
+       de::MovePtr<Allocation>                 bufferAlloc;
+       Move<VkCommandPool>                             cmdPool;
+       Move<VkCommandBuffer>                   cmdBuffer;
+       Move<VkFence>                                   fence;
+
+       tcu::TextureFormat                              retFormat               (tcu::TextureFormat::D, tcu::TextureFormat::CHANNELTYPE_LAST);
+       tcu::TextureFormat                              bufferFormat    (tcu::TextureFormat::D, tcu::TextureFormat::CHANNELTYPE_LAST);
+       switch (format)
+       {
+       case vk::VK_FORMAT_D16_UNORM:
+       case vk::VK_FORMAT_D16_UNORM_S8_UINT:
+               bufferFormat.type = retFormat.type = tcu::TextureFormat::UNORM_INT16;
+               break;
+       case vk::VK_FORMAT_D24_UNORM_S8_UINT:
+       case vk::VK_FORMAT_X8_D24_UNORM_PACK32:
+               retFormat.type = tcu::TextureFormat::UNORM_INT24;
+               // vkCmdCopyBufferToImage copies D24 data to 32-bit pixels.
+               bufferFormat.type = tcu::TextureFormat::UNSIGNED_INT_24_8_REV;
+               break;
+       case vk::VK_FORMAT_D32_SFLOAT:
+       case vk::VK_FORMAT_D32_SFLOAT_S8_UINT:
+               bufferFormat.type = retFormat.type = tcu::TextureFormat::FLOAT;
+               break;
+       default:
+               TCU_FAIL("unrecognized format");
+       }
+
+       const VkDeviceSize                              pixelDataSize   = renderSize.x() * renderSize.y() * bufferFormat.getPixelSize();
+       de::MovePtr<tcu::TextureLevel>  resultLevel             (new tcu::TextureLevel(retFormat, renderSize.x(), renderSize.y()));
+
+       // Create destination buffer
+       {
+               const VkBufferCreateInfo bufferParams =
+               {
+                       VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO,           // VkStructureType              sType;
+                       DE_NULL,                                                                        // const void*                  pNext;
+                       0u,                                                                                     // VkBufferCreateFlags  flags;
+                       pixelDataSize,                                                          // VkDeviceSize                 size;
+                       VK_BUFFER_USAGE_TRANSFER_DST_BIT,                       // VkBufferUsageFlags   usage;
+                       VK_SHARING_MODE_EXCLUSIVE,                                      // VkSharingMode                sharingMode;
+                       0u,                                                                                     // deUint32                             queueFamilyIndexCount;
+                       DE_NULL                                                                         // const deUint32*              pQueueFamilyIndices;
+               };
+
+               buffer          = createBuffer(vk, device, &bufferParams);
+               bufferAlloc = allocator.allocate(getBufferMemoryRequirements(vk, device, *buffer), MemoryRequirement::HostVisible);
+               VK_CHECK(vk.bindBufferMemory(device, *buffer, bufferAlloc->getMemory(), bufferAlloc->getOffset()));
+       }
+
+       // Create command pool and buffer
+       cmdPool         = createCommandPool(vk, device, VK_COMMAND_POOL_CREATE_TRANSIENT_BIT, queueFamilyIndex);
+       cmdBuffer       = allocateCommandBuffer(vk, device, *cmdPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY);
+
+       // Create fence
+       fence = createFence(vk, device);
+
+       beginCommandBuffer(vk, *cmdBuffer);
+
+       const VkImageSubresourceLayers  subresource     =
+       {
+               VK_IMAGE_ASPECT_DEPTH_BIT,                                      // VkImageAspectFlags   aspectMask;
+               0u,                                                                                     // deUint32                             mipLevel;
+               0u,                                                                                     // deUint32                             baseArrayLayer;
+               1u,                                                                                     // deUint32                             layerCount;
+       };
+
+       const VkBufferImageCopy                 region          =
+       {
+               0ull,                                                                                           // VkDeviceSize                                 bufferOffset;
+               0u,                                                                                                     // deUint32                                             bufferRowLength;
+               0u,                                                                                                     // deUint32                                             bufferImageHeight;
+               subresource,                                                                            // VkImageSubresourceLayers             imageSubresource;
+               makeOffset3D(0, 0, 0),                                                          // VkOffset3D                                   imageOffset;
+               makeExtent3D(renderSize.x(), renderSize.y(), 1u)        // VkExtent3D                                   imageExtent;
+       };
+
+       vk.cmdCopyImageToBuffer(*cmdBuffer, image, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, *buffer, 1u, &region);
+
+       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;
+               *buffer,                                                                        // VkBuffer                     buffer;
+               0ull,                                                                           // VkDeviceSize         offset;
+               VK_WHOLE_SIZE                                                           // VkDeviceSize         size;
+       };
+
+       vk.cmdPipelineBarrier(*cmdBuffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_HOST_BIT, 0u,
+                                                 0u, DE_NULL, 1u, &bufferBarrier, 0u, DE_NULL);
+
+       endCommandBuffer(vk, *cmdBuffer);
+
+       submitCommandsAndWait(vk, device, queue, cmdBuffer.get());
+
+       // Read buffer data
+       invalidateAlloc(vk, device, *bufferAlloc);
+       tcu::copy(*resultLevel, tcu::ConstPixelBufferAccess(bufferFormat, resultLevel->getSize(), bufferAlloc->getHostPtr()));
+
+       return resultLevel;
+}
+
 void uploadTestTextureInternal (const DeviceInterface& vk,
                                                                VkDevice                                device,
                                                                VkQueue                                 queue,
index 82b6b88..03e25ff 100644 (file)
@@ -85,6 +85,24 @@ de::MovePtr<tcu::TextureLevel>       readColorAttachment                      (const vk::DeviceInterface
                                                                                                                          vk::VkFormat                                  format,
                                                                                                                          const tcu::UVec2&                             renderSize);
 
+
+/*--------------------------------------------------------------------*//*!
+ * Gets a tcu::TextureLevel initialized with data from a VK depth
+ * attachment.
+ *
+ * The VkImage must be non-multisampled and able to be used as a source
+ * operand for transfer operations.
+ *//*--------------------------------------------------------------------*/
+de::MovePtr<tcu::TextureLevel> readDepthAttachment                      (const vk::DeviceInterface&    vk,
+                                                                                                                         vk::VkDevice                                  device,
+                                                                                                                         vk::VkQueue                                   queue,
+                                                                                                                         deUint32                                              queueFamilyIndex,
+                                                                                                                         vk::Allocator&                                allocator,
+                                                                                                                         vk::VkImage                                   image,
+                                                                                                                         vk::VkFormat                                  format,
+                                                                                                                         const tcu::UVec2&                             renderSize);
+
+
 /*--------------------------------------------------------------------*//*!
  * Uploads data from a test texture to a destination VK image.
  *
index 4c58639..3fe4355 100644 (file)
@@ -210,6 +210,9 @@ ReferenceRenderer::ReferenceRenderer(int                                            surfaceWidth,
                        m_depthStencilBuffer.setStorage(m_depthStencilFormat, actualSamples, surfaceWidth, surfaceHeight);
                        tcu::clearDepth(m_depthStencilBuffer.getAccess(), defaultClearDepth());
 
+                       m_resolveDepthBuffer.setStorage(m_depthStencilFormat, surfaceWidth, surfaceHeight);
+                       tcu::clearDepth(m_resolveDepthBuffer.getAccess(), defaultClearDepth());
+
                        m_renderTarget = new rr::RenderTarget(rr::MultisamplePixelBufferAccess::fromMultisampleAccess(m_colorBuffer.getAccess()),
                                                                                                  rr::MultisamplePixelBufferAccess::fromMultisampleAccess(m_depthStencilBuffer.getAccess()));
                }
@@ -229,6 +232,9 @@ ReferenceRenderer::ReferenceRenderer(int                                            surfaceWidth,
                        tcu::clearDepth(m_depthStencilBuffer.getAccess(), defaultClearDepth());
                        tcu::clearStencil(m_depthStencilBuffer.getAccess(), defaultClearStencil());
 
+                       m_resolveDepthBuffer.setStorage(m_depthStencilFormat, surfaceWidth, surfaceHeight);
+                       tcu::clearDepth(m_resolveDepthBuffer.getAccess(), defaultClearDepth());
+
                        m_renderTarget = new rr::RenderTarget(rr::MultisamplePixelBufferAccess::fromMultisampleAccess(m_colorBuffer.getAccess()),
                                                                                                  rr::MultisamplePixelBufferAccess::fromMultisampleAccess(m_depthStencilBuffer.getAccess()),
                                                                                                  rr::MultisamplePixelBufferAccess::fromMultisampleAccess(m_depthStencilBuffer.getAccess()));
@@ -323,6 +329,14 @@ tcu::PixelBufferAccess ReferenceRenderer::getAccess (void)
        return m_resolveColorBuffer.getAccess();
 }
 
+tcu::PixelBufferAccess ReferenceRenderer::getDepthAccess(void)
+{
+       rr::MultisampleConstPixelBufferAccess multiSampleAccess = rr::MultisampleConstPixelBufferAccess::fromMultisampleAccess(m_depthStencilBuffer.getAccess());
+       rr::resolveMultisampleColorBuffer(m_resolveDepthBuffer.getAccess(), multiSampleAccess);
+
+       return m_resolveDepthBuffer.getAccess();
+}
+
 const rr::ViewportState ReferenceRenderer::getViewportState (void) const
 {
        return rr::ViewportState(rr::WindowRectangle(0, 0, m_surfaceWidth, m_surfaceHeight));
index 4cf3356..3352a08 100644 (file)
@@ -243,6 +243,7 @@ public:
                                                                                                                 const std::vector<Vertex4Tex4>&        vertexBuffer);
 
        tcu::PixelBufferAccess          getAccess                               (void);
+       tcu::PixelBufferAccess          getDepthAccess                  (void);
        const rr::ViewportState         getViewportState                (void) const;
 
 private:
@@ -258,6 +259,7 @@ private:
        tcu::TextureLevel                       m_colorBuffer;
        tcu::TextureLevel                       m_resolveColorBuffer;
        tcu::TextureLevel                       m_depthStencilBuffer;
+       tcu::TextureLevel                       m_resolveDepthBuffer;
 
        rr::RenderTarget*                       m_renderTarget;
        const rr::Program*                      m_program;
index 6f734b9..a252841 100644 (file)
@@ -111454,6 +111454,7 @@ dEQP-VK.pipeline.depth.format.d16_unorm.compare_ops.not_equal_not_equal_greater_
 dEQP-VK.pipeline.depth.format.d16_unorm.compare_ops.not_equal_less_or_equal_not_equal_greater
 dEQP-VK.pipeline.depth.format.d16_unorm.compare_ops.not_equal_less_or_equal_not_equal_greater_depth_bounds_test
 dEQP-VK.pipeline.depth.format.d16_unorm.compare_ops.never_zerodepthbounds_depthdisabled_stencilenabled
+dEQP-VK.pipeline.depth.format.d16_unorm.depth_test_disabled.depth_write_enabled
 dEQP-VK.pipeline.depth.format.x8_d24_unorm_pack32.compare_ops.not_equal_not_equal_not_equal_not_equal
 dEQP-VK.pipeline.depth.format.x8_d24_unorm_pack32.compare_ops.not_equal_not_equal_not_equal_not_equal_depth_bounds_test
 dEQP-VK.pipeline.depth.format.x8_d24_unorm_pack32.compare_ops.not_equal_equal_equal_greater
@@ -111603,6 +111604,7 @@ dEQP-VK.pipeline.depth.format.x8_d24_unorm_pack32.compare_ops.not_equal_not_equa
 dEQP-VK.pipeline.depth.format.x8_d24_unorm_pack32.compare_ops.not_equal_less_or_equal_not_equal_greater
 dEQP-VK.pipeline.depth.format.x8_d24_unorm_pack32.compare_ops.not_equal_less_or_equal_not_equal_greater_depth_bounds_test
 dEQP-VK.pipeline.depth.format.x8_d24_unorm_pack32.compare_ops.never_zerodepthbounds_depthdisabled_stencilenabled
+dEQP-VK.pipeline.depth.format.x8_d24_unorm_pack32.depth_test_disabled.depth_write_enabled
 dEQP-VK.pipeline.depth.format.d32_sfloat.compare_ops.not_equal_not_equal_not_equal_not_equal
 dEQP-VK.pipeline.depth.format.d32_sfloat.compare_ops.not_equal_not_equal_not_equal_not_equal_depth_bounds_test
 dEQP-VK.pipeline.depth.format.d32_sfloat.compare_ops.not_equal_equal_equal_greater
@@ -111752,6 +111754,7 @@ dEQP-VK.pipeline.depth.format.d32_sfloat.compare_ops.not_equal_not_equal_greater
 dEQP-VK.pipeline.depth.format.d32_sfloat.compare_ops.not_equal_less_or_equal_not_equal_greater
 dEQP-VK.pipeline.depth.format.d32_sfloat.compare_ops.not_equal_less_or_equal_not_equal_greater_depth_bounds_test
 dEQP-VK.pipeline.depth.format.d32_sfloat.compare_ops.never_zerodepthbounds_depthdisabled_stencilenabled
+dEQP-VK.pipeline.depth.format.d32_sfloat.depth_test_disabled.depth_write_enabled
 dEQP-VK.pipeline.depth.format.d16_unorm_s8_uint.compare_ops.not_equal_not_equal_not_equal_not_equal
 dEQP-VK.pipeline.depth.format.d16_unorm_s8_uint.compare_ops.not_equal_not_equal_not_equal_not_equal_depth_bounds_test
 dEQP-VK.pipeline.depth.format.d16_unorm_s8_uint.compare_ops.not_equal_equal_equal_greater
@@ -111901,6 +111904,7 @@ dEQP-VK.pipeline.depth.format.d16_unorm_s8_uint.compare_ops.not_equal_not_equal_
 dEQP-VK.pipeline.depth.format.d16_unorm_s8_uint.compare_ops.not_equal_less_or_equal_not_equal_greater
 dEQP-VK.pipeline.depth.format.d16_unorm_s8_uint.compare_ops.not_equal_less_or_equal_not_equal_greater_depth_bounds_test
 dEQP-VK.pipeline.depth.format.d16_unorm_s8_uint.compare_ops.never_zerodepthbounds_depthdisabled_stencilenabled
+dEQP-VK.pipeline.depth.format.d16_unorm_s8_uint.depth_test_disabled.depth_write_enabled
 dEQP-VK.pipeline.depth.format.d24_unorm_s8_uint.compare_ops.not_equal_not_equal_not_equal_not_equal
 dEQP-VK.pipeline.depth.format.d24_unorm_s8_uint.compare_ops.not_equal_not_equal_not_equal_not_equal_depth_bounds_test
 dEQP-VK.pipeline.depth.format.d24_unorm_s8_uint.compare_ops.not_equal_equal_equal_greater
@@ -112050,6 +112054,7 @@ dEQP-VK.pipeline.depth.format.d24_unorm_s8_uint.compare_ops.not_equal_not_equal_
 dEQP-VK.pipeline.depth.format.d24_unorm_s8_uint.compare_ops.not_equal_less_or_equal_not_equal_greater
 dEQP-VK.pipeline.depth.format.d24_unorm_s8_uint.compare_ops.not_equal_less_or_equal_not_equal_greater_depth_bounds_test
 dEQP-VK.pipeline.depth.format.d24_unorm_s8_uint.compare_ops.never_zerodepthbounds_depthdisabled_stencilenabled
+dEQP-VK.pipeline.depth.format.d24_unorm_s8_uint.depth_test_disabled.depth_write_enabled
 dEQP-VK.pipeline.depth.format.d32_sfloat_s8_uint.compare_ops.not_equal_not_equal_not_equal_not_equal
 dEQP-VK.pipeline.depth.format.d32_sfloat_s8_uint.compare_ops.not_equal_not_equal_not_equal_not_equal_depth_bounds_test
 dEQP-VK.pipeline.depth.format.d32_sfloat_s8_uint.compare_ops.not_equal_equal_equal_greater
@@ -112199,6 +112204,7 @@ dEQP-VK.pipeline.depth.format.d32_sfloat_s8_uint.compare_ops.not_equal_not_equal
 dEQP-VK.pipeline.depth.format.d32_sfloat_s8_uint.compare_ops.not_equal_less_or_equal_not_equal_greater
 dEQP-VK.pipeline.depth.format.d32_sfloat_s8_uint.compare_ops.not_equal_less_or_equal_not_equal_greater_depth_bounds_test
 dEQP-VK.pipeline.depth.format.d32_sfloat_s8_uint.compare_ops.never_zerodepthbounds_depthdisabled_stencilenabled
+dEQP-VK.pipeline.depth.format.d32_sfloat_s8_uint.depth_test_disabled.depth_write_enabled
 dEQP-VK.pipeline.dynamic_offset.graphics.uniform_buffer.numcmdbuffers_1.sameorder.numdescriptorsetbindings_1.numdynamicbindings_1.numnondynamicbindings_0
 dEQP-VK.pipeline.dynamic_offset.graphics.uniform_buffer.numcmdbuffers_1.sameorder.numdescriptorsetbindings_1.numdynamicbindings_1.numnondynamicbindings_1
 dEQP-VK.pipeline.dynamic_offset.graphics.uniform_buffer.numcmdbuffers_1.sameorder.numdescriptorsetbindings_1.numdynamicbindings_2.numnondynamicbindings_0
index 79dcf5f..f351e58 100644 (file)
@@ -111454,6 +111454,7 @@ dEQP-VK.pipeline.depth.format.d16_unorm.compare_ops.not_equal_not_equal_greater_
 dEQP-VK.pipeline.depth.format.d16_unorm.compare_ops.not_equal_less_or_equal_not_equal_greater
 dEQP-VK.pipeline.depth.format.d16_unorm.compare_ops.not_equal_less_or_equal_not_equal_greater_depth_bounds_test
 dEQP-VK.pipeline.depth.format.d16_unorm.compare_ops.never_zerodepthbounds_depthdisabled_stencilenabled
+dEQP-VK.pipeline.depth.format.d16_unorm.depth_test_disabled.depth_write_enabled
 dEQP-VK.pipeline.depth.format.x8_d24_unorm_pack32.compare_ops.not_equal_not_equal_not_equal_not_equal
 dEQP-VK.pipeline.depth.format.x8_d24_unorm_pack32.compare_ops.not_equal_not_equal_not_equal_not_equal_depth_bounds_test
 dEQP-VK.pipeline.depth.format.x8_d24_unorm_pack32.compare_ops.not_equal_equal_equal_greater
@@ -111603,6 +111604,7 @@ dEQP-VK.pipeline.depth.format.x8_d24_unorm_pack32.compare_ops.not_equal_not_equa
 dEQP-VK.pipeline.depth.format.x8_d24_unorm_pack32.compare_ops.not_equal_less_or_equal_not_equal_greater
 dEQP-VK.pipeline.depth.format.x8_d24_unorm_pack32.compare_ops.not_equal_less_or_equal_not_equal_greater_depth_bounds_test
 dEQP-VK.pipeline.depth.format.x8_d24_unorm_pack32.compare_ops.never_zerodepthbounds_depthdisabled_stencilenabled
+dEQP-VK.pipeline.depth.format.x8_d24_unorm_pack32.depth_test_disabled.depth_write_enabled
 dEQP-VK.pipeline.depth.format.d32_sfloat.compare_ops.not_equal_not_equal_not_equal_not_equal
 dEQP-VK.pipeline.depth.format.d32_sfloat.compare_ops.not_equal_not_equal_not_equal_not_equal_depth_bounds_test
 dEQP-VK.pipeline.depth.format.d32_sfloat.compare_ops.not_equal_equal_equal_greater
@@ -111752,6 +111754,7 @@ dEQP-VK.pipeline.depth.format.d32_sfloat.compare_ops.not_equal_not_equal_greater
 dEQP-VK.pipeline.depth.format.d32_sfloat.compare_ops.not_equal_less_or_equal_not_equal_greater
 dEQP-VK.pipeline.depth.format.d32_sfloat.compare_ops.not_equal_less_or_equal_not_equal_greater_depth_bounds_test
 dEQP-VK.pipeline.depth.format.d32_sfloat.compare_ops.never_zerodepthbounds_depthdisabled_stencilenabled
+dEQP-VK.pipeline.depth.format.d32_sfloat.depth_test_disabled.depth_write_enabled
 dEQP-VK.pipeline.depth.format.d16_unorm_s8_uint.compare_ops.not_equal_not_equal_not_equal_not_equal
 dEQP-VK.pipeline.depth.format.d16_unorm_s8_uint.compare_ops.not_equal_not_equal_not_equal_not_equal_depth_bounds_test
 dEQP-VK.pipeline.depth.format.d16_unorm_s8_uint.compare_ops.not_equal_equal_equal_greater
@@ -111901,6 +111904,7 @@ dEQP-VK.pipeline.depth.format.d16_unorm_s8_uint.compare_ops.not_equal_not_equal_
 dEQP-VK.pipeline.depth.format.d16_unorm_s8_uint.compare_ops.not_equal_less_or_equal_not_equal_greater
 dEQP-VK.pipeline.depth.format.d16_unorm_s8_uint.compare_ops.not_equal_less_or_equal_not_equal_greater_depth_bounds_test
 dEQP-VK.pipeline.depth.format.d16_unorm_s8_uint.compare_ops.never_zerodepthbounds_depthdisabled_stencilenabled
+dEQP-VK.pipeline.depth.format.d16_unorm_s8_uint.depth_test_disabled.depth_write_enabled
 dEQP-VK.pipeline.depth.format.d24_unorm_s8_uint.compare_ops.not_equal_not_equal_not_equal_not_equal
 dEQP-VK.pipeline.depth.format.d24_unorm_s8_uint.compare_ops.not_equal_not_equal_not_equal_not_equal_depth_bounds_test
 dEQP-VK.pipeline.depth.format.d24_unorm_s8_uint.compare_ops.not_equal_equal_equal_greater
@@ -112050,6 +112054,7 @@ dEQP-VK.pipeline.depth.format.d24_unorm_s8_uint.compare_ops.not_equal_not_equal_
 dEQP-VK.pipeline.depth.format.d24_unorm_s8_uint.compare_ops.not_equal_less_or_equal_not_equal_greater
 dEQP-VK.pipeline.depth.format.d24_unorm_s8_uint.compare_ops.not_equal_less_or_equal_not_equal_greater_depth_bounds_test
 dEQP-VK.pipeline.depth.format.d24_unorm_s8_uint.compare_ops.never_zerodepthbounds_depthdisabled_stencilenabled
+dEQP-VK.pipeline.depth.format.d24_unorm_s8_uint.depth_test_disabled.depth_write_enabled
 dEQP-VK.pipeline.depth.format.d32_sfloat_s8_uint.compare_ops.not_equal_not_equal_not_equal_not_equal
 dEQP-VK.pipeline.depth.format.d32_sfloat_s8_uint.compare_ops.not_equal_not_equal_not_equal_not_equal_depth_bounds_test
 dEQP-VK.pipeline.depth.format.d32_sfloat_s8_uint.compare_ops.not_equal_equal_equal_greater
@@ -112199,6 +112204,7 @@ dEQP-VK.pipeline.depth.format.d32_sfloat_s8_uint.compare_ops.not_equal_not_equal
 dEQP-VK.pipeline.depth.format.d32_sfloat_s8_uint.compare_ops.not_equal_less_or_equal_not_equal_greater
 dEQP-VK.pipeline.depth.format.d32_sfloat_s8_uint.compare_ops.not_equal_less_or_equal_not_equal_greater_depth_bounds_test
 dEQP-VK.pipeline.depth.format.d32_sfloat_s8_uint.compare_ops.never_zerodepthbounds_depthdisabled_stencilenabled
+dEQP-VK.pipeline.depth.format.d32_sfloat_s8_uint.depth_test_disabled.depth_write_enabled
 dEQP-VK.pipeline.dynamic_offset.graphics.uniform_buffer.numcmdbuffers_1.sameorder.numdescriptorsetbindings_1.numdynamicbindings_1.numnondynamicbindings_0
 dEQP-VK.pipeline.dynamic_offset.graphics.uniform_buffer.numcmdbuffers_1.sameorder.numdescriptorsetbindings_1.numdynamicbindings_1.numnondynamicbindings_1
 dEQP-VK.pipeline.dynamic_offset.graphics.uniform_buffer.numcmdbuffers_1.sameorder.numdescriptorsetbindings_1.numdynamicbindings_2.numnondynamicbindings_0