Merge gerrit/vulkan-cts-1.0.2 into gerrit/vulkan-cts-1.0.2-extensions
authorPyry Haulos <phaulos@google.com>
Fri, 6 Jan 2017 20:44:57 +0000 (12:44 -0800)
committerPyry Haulos <phaulos@google.com>
Fri, 6 Jan 2017 20:44:57 +0000 (12:44 -0800)
Change-Id: I71d19d9c1ad5542f7aa047820b48328e4b0f5c52

1  2 
external/vulkancts/modules/vulkan/api/vktApiObjectManagementTests.cpp

@@@ -302,11 -302,6 +302,11 @@@ T alignToPowerOfTwo (T value, T align
        return (value + align - T(1)) & ~(align - T(1));
  }
  
 +inline bool hasDeviceExtension (Context& context, const string& name)
 +{
 +      return de::contains(context.getDeviceExtensions().begin(), context.getDeviceExtensions().end(), name);
 +}
 +
  VkDeviceSize getPageTableSize (const PlatformMemoryLimits& limits, VkDeviceSize allocationSize)
  {
        VkDeviceSize    totalSize       = 0;
        return totalSize;
  }
  
 -
 -
  size_t getCurrentSystemMemoryUsage (const AllocationCallbackRecorder& allocRecoder)
  {
        const size_t                                            systemAllocationOverhead        = sizeof(void*)*2;
@@@ -2467,8 -2464,8 +2467,8 @@@ tcu::TestStatus allocCallbackFailTest (
                for (; numPassingAllocs < maxTries; ++numPassingAllocs)
                {
                        DeterministicFailAllocator                      objAllocator(getSystemAllocator(),
-                                                                                                                        numPassingAllocs,
-                                                                                                                        DeterministicFailAllocator::MODE_COUNT_AND_FAIL);
+                                                                                                                        DeterministicFailAllocator::MODE_COUNT_AND_FAIL,
+                                                                                                                        numPassingAllocs);
                        AllocationCallbackRecorder                      recorder        (objAllocator.getCallbacks(), 128);
                        const Environment                                       objEnv          (resEnv.env.vkp,
                                                                                                                         resEnv.env.vkd,
  }
  
  // Determine whether an API call sets the invalid handles to NULL (true) or leaves them undefined or not modified (false)
 -template<typename T> inline bool isNullHandleOnAllocationFailure                       (void) { return false; }
 -template<>                     inline bool isNullHandleOnAllocationFailure<VkPipeline> (void) { return true;  }
 +template<typename T> inline bool isNullHandleOnAllocationFailure                                (Context&)             { return false; }
 +template<>                     inline bool isNullHandleOnAllocationFailure<VkCommandBuffer> (Context& context) { return hasDeviceExtension(context, "VK_KHR_maintenance1"); }
 +template<>                     inline bool isNullHandleOnAllocationFailure<VkDescriptorSet> (Context& context) { return hasDeviceExtension(context, "VK_KHR_maintenance1"); }
 +template<>                     inline bool isNullHandleOnAllocationFailure<VkPipeline>          (Context&)             { return true;  }
  
 -template<typename T> inline bool isPooledObject                                                                (void) { return false; };
 -template<>                     inline bool isPooledObject<VkCommandBuffer>                     (void) { return true;  };
 -template<>                     inline bool isPooledObject<VkDescriptorSet>                     (void) { return true;  };
 +template<typename T> inline bool isPooledObject                                        (void) { return false; };
 +template<>                     inline bool isPooledObject<VkCommandBuffer> (void) { return true;  };
 +template<>                     inline bool isPooledObject<VkDescriptorSet> (void) { return true;  };
  
  template<typename Object>
  tcu::TestStatus allocCallbackFailMultipleObjectsTest (Context& context, typename Object::Parameters params)
        typedef SharedPtr<Move<typename Object::Type> > ObjectTypeSp;
  
        static const deUint32   numObjects                      = 4;
 -      const bool                              expectNullHandles       = isNullHandleOnAllocationFailure<typename Object::Type>();
 +      const bool                              expectNullHandles       = isNullHandleOnAllocationFailure<typename Object::Type>(context);
        deUint32                                numPassingAllocs        = 0;
  
        {
  
                        // \note We have to use the same allocator for both resource dependencies and the object under test,
                        //       because pooled objects take memory from the pool.
-                       DeterministicFailAllocator                      objAllocator(getSystemAllocator(), numPassingAllocs, DeterministicFailAllocator::MODE_DO_NOT_COUNT);
+                       DeterministicFailAllocator                      objAllocator(getSystemAllocator(), DeterministicFailAllocator::MODE_DO_NOT_COUNT, 0);
                        AllocationCallbackRecorder                      recorder        (objAllocator.getCallbacks(), 128);
                        const Environment                                       objEnv          (context.getPlatformInterface(),
                                                                                                                         context.getDeviceInterface(),
                        {
                                const typename Object::Resources res (objEnv, params);
  
-                               objAllocator.setMode(DeterministicFailAllocator::MODE_COUNT_AND_FAIL);
+                               objAllocator.reset(DeterministicFailAllocator::MODE_COUNT_AND_FAIL, numPassingAllocs);
                                const vector<ObjectTypeSp> scopedHandles = Object::createMultiple(objEnv, res, params, &handles, &result);
                        }