tests:Driver Workaround and notes
authorTobin Ehlis <tobine@google.com>
Wed, 6 Dec 2017 17:31:48 +0000 (10:31 -0700)
committerTobin Ehlis <tobine@google.com>
Thu, 14 Dec 2017 00:43:22 +0000 (17:43 -0700)
At least 1 device's driver is crashing when VK_REMAINING_* values are
used for range level and mip specifiers. Modify these cases to be hard-
coded values instead.
Also add some comments related to workarounds.

tests/layer_validation_tests.cpp
tests/vkrenderframework.cpp

index e7b7feb..efe7ba8 100644 (file)
@@ -577,17 +577,17 @@ void VkLayerTest::VKTriangleTest(BsoFailSelect failCase) {
             break;
         }
         case BsoFailStencilReadMask: {
-            failcase_needs_depth = true;
+            // failcase_needs_depth = true; // Mali driver failing if DS gets cleared
             pipelineobj.MakeDynamic(VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK);
             break;
         }
         case BsoFailStencilWriteMask: {
-            failcase_needs_depth = true;
+            // failcase_needs_depth = true; // Mali driver failing if DS gets cleared
             pipelineobj.MakeDynamic(VK_DYNAMIC_STATE_STENCIL_WRITE_MASK);
             break;
         }
         case BsoFailStencilReference: {
-            failcase_needs_depth = true;
+            // failcase_needs_depth = true; // Mali driver failing if DS gets cleared
             pipelineobj.MakeDynamic(VK_DYNAMIC_STATE_STENCIL_REFERENCE);
             break;
         }
@@ -6633,7 +6633,7 @@ TEST_F(VkLayerTest, InvalidCmdBufferBufferViewDestroyed) {
     vkCmdSetViewport(m_commandBuffer->handle(), 0, 1, &viewport);
     VkRect2D scissor = {{0, 0}, {16, 16}};
     vkCmdSetScissor(m_commandBuffer->handle(), 0, 1, &scissor);
-    // Bind pipeline to cmd buffer
+    // Bind pipeline to cmd buffer - This causes crash on Mali
     vkCmdBindPipeline(m_commandBuffer->handle(), VK_PIPELINE_BIND_POINT_GRAPHICS, pipe.handle());
     vkCmdBindDescriptorSets(m_commandBuffer->handle(), VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline_layout, 0, 1, &descriptor_set, 0,
                             nullptr);
@@ -17497,7 +17497,7 @@ TEST_F(VkLayerTest, DrawTimeImageMultisampleMismatchWithPipeline) {
     pipe.AddShader(&fs);
     pipe.AddDefaultColorAttachment();
 
-    VkTextureObj texture(m_device, nullptr);
+    VkTextureObj texture(m_device, nullptr); // THIS LINE CAUSES CRASH ON MALI
     VkSamplerObj sampler(m_device);
 
     VkDescriptorSetObj descriptorSet(m_device);
index a326896..4fa9c50 100644 (file)
@@ -699,8 +699,9 @@ void VkImageObj::ImageMemoryBarrier(VkCommandBufferObj *cmd_buf, VkImageAspectFl
             VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT |
             VK_MEMORY_INPUT_COPY_BIT*/,
                                     VkImageLayout image_layout) {
+    // TODO: Mali device crashing with VK_REMAINING_MIP_LEVELS
     const VkImageSubresourceRange subresourceRange =
-        subresource_range(aspect, 0, VK_REMAINING_MIP_LEVELS, 0, VK_REMAINING_ARRAY_LAYERS);
+        subresource_range(aspect, 0, /*VK_REMAINING_MIP_LEVELS*/ 1, 0, 1/*VK_REMAINING_ARRAY_LAYERS*/);
     VkImageMemoryBarrier barrier;
     barrier = image_memory_barrier(output_mask, input_mask, Layout(), image_layout, subresourceRange);
 
@@ -1349,9 +1350,11 @@ void VkCommandBufferObj::ClearAllBuffers(const vector<VkImageObj *> &color_objs,
     VkImageSubresourceRange subrange = {};
     // srRange.aspectMask to be set later
     subrange.baseMipLevel = 0;
-    subrange.levelCount = VK_REMAINING_MIP_LEVELS;
+    // TODO: Mali device crashing with VK_REMAINING_MIP_LEVELS
+    subrange.levelCount = 1;  // VK_REMAINING_MIP_LEVELS;
     subrange.baseArrayLayer = 0;
-    subrange.layerCount = VK_REMAINING_ARRAY_LAYERS;
+    // TODO: Mesa crashing with VK_REMAINING_ARRAY_LAYERS
+    subrange.layerCount = 1; // VK_REMAINING_ARRAY_LAYERS;
 
     const VkImageLayout clear_layout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL;