anv: Get rid of the stub() macros
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 7 Mar 2017 17:19:29 +0000 (09:19 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 7 Mar 2017 23:22:16 +0000 (15:22 -0800)
Except for a few unimplemented things on gen7, we don't really have
stubs anymore so we should drop this.  This commit replaces the few gen7
stub() calls with explicitly labeled finishme's and makes the sparse
binding stuff silently no-op or return a FEATURE_NOT_PRESENT error.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
src/intel/vulkan/anv_device.c
src/intel/vulkan/anv_private.h
src/intel/vulkan/gen7_cmd_buffer.c

index fbcbd40c61f0c349259669a348108ddcb100f9e7..7a087bd0f0640340d588b93d5aa696a5c73a6ff6 100644 (file)
@@ -1603,7 +1603,7 @@ void anv_GetImageSparseMemoryRequirements(
     uint32_t*                                   pSparseMemoryRequirementCount,
     VkSparseImageMemoryRequirements*            pSparseMemoryRequirements)
 {
-   stub();
+   *pSparseMemoryRequirementCount = 0;
 }
 
 void anv_GetDeviceMemoryCommitment(
@@ -1640,7 +1640,7 @@ VkResult anv_QueueBindSparse(
     const VkBindSparseInfo*                     pBindInfo,
     VkFence                                     fence)
 {
-   stub_return(VK_ERROR_INCOMPATIBLE_DRIVER);
+   return vk_error(VK_ERROR_FEATURE_NOT_PRESENT);
 }
 
 VkResult anv_CreateFence(
index e2aeb4f86d7d09dfe06c05652881ff0319423881..7d3fd40d7c51c30be43ebf235663ec1f5dc6c38f 100644 (file)
@@ -279,18 +279,6 @@ void anv_loge_v(const char *format, va_list va);
 #define anv_validate if (0)
 #endif
 
-#define stub_return(v) \
-   do { \
-      anv_finishme("stub %s", __func__); \
-      return (v); \
-   } while (0)
-
-#define stub() \
-   do { \
-      anv_finishme("stub %s", __func__); \
-      return; \
-   } while (0)
-
 /**
  * A dynamically growable, circular buffer.  Elements are added at head and
  * removed from tail. head and tail are free-running uint32_t indices and we
index 01abadb49e129b0583799d992a4ef7df1c4fbdf5..b1721c78ba0c732365856b02cb642e5fd15fbcca 100644 (file)
@@ -270,7 +270,7 @@ void genX(CmdSetEvent)(
     VkEvent                                     event,
     VkPipelineStageFlags                        stageMask)
 {
-   stub();
+   anv_finishme("Implement events on gen7");
 }
 
 void genX(CmdResetEvent)(
@@ -278,7 +278,7 @@ void genX(CmdResetEvent)(
     VkEvent                                     event,
     VkPipelineStageFlags                        stageMask)
 {
-   stub();
+   anv_finishme("Implement events on gen7");
 }
 
 void genX(CmdWaitEvents)(
@@ -294,7 +294,7 @@ void genX(CmdWaitEvents)(
     uint32_t                                    imageMemoryBarrierCount,
     const VkImageMemoryBarrier*                 pImageMemoryBarriers)
 {
-   stub();
+   anv_finishme("Implement events on gen7");
 
    genX(CmdPipelineBarrier)(commandBuffer, srcStageMask, destStageMask,
                             false, /* byRegion */