anv: Remove all support for BufferViews
authorJason Ekstrand <jason.ekstrand@intel.com>
Fri, 6 Nov 2015 21:16:15 +0000 (13:16 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Fri, 6 Nov 2015 21:16:18 +0000 (13:16 -0800)
We never *actually* supported them, we just used them for binding UBOs.
Now that we have BufferInfo and we aren't supporting texture buffers yet,
we should get rid of them until we can do them properly.

src/vulkan/anv_cmd_buffer.c
src/vulkan/anv_device.c
src/vulkan/anv_private.h
src/vulkan/gen7_state.c
src/vulkan/gen8_state.c

index 5ce57f1d98e449d3884f4a6da6ebc259700359d3..be8a537f6562b035fbc835faecdb928d674d1828 100644 (file)
@@ -605,11 +605,6 @@ anv_cmd_buffer_emit_binding_table(struct anv_cmd_buffer *cmd_buffer,
       case ANV_DESCRIPTOR_TYPE_SAMPLER:
          /* Nothing for us to do here */
          continue;
-      case ANV_DESCRIPTOR_TYPE_BUFFER_VIEW:
-         surface_state = desc->buffer_view->surface_state;
-         bo = desc->buffer_view->bo;
-         bo_offset = desc->buffer_view->offset;
-         break;
       case ANV_DESCRIPTOR_TYPE_BUFFER_AND_OFFSET: {
          bo = desc->buffer->bo;
          bo_offset = desc->buffer->offset + desc->offset;
index af5f8d25de11fecc5576f065b946a6797e5ef93f..2e330e6bbad902caa7502c2650b7f9244efbe3d9 100644 (file)
@@ -1429,44 +1429,19 @@ anv_fill_buffer_surface_state(struct anv_device *device, void *state,
    }
 }
 
-VkResult
-anv_buffer_view_create(
-   struct anv_device *                          device,
-   const VkBufferViewCreateInfo*                pCreateInfo,
-   struct anv_buffer_view **                    bview_out)
+VkResult anv_CreateBufferView(
+    VkDevice                                    _device,
+    const VkBufferViewCreateInfo*               pCreateInfo,
+    VkBufferView*                               pView)
 {
-   ANV_FROM_HANDLE(anv_buffer, buffer, pCreateInfo->buffer);
-   struct anv_buffer_view *bview;
-
-   assert(pCreateInfo->sType == VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO);
-
-   bview = anv_device_alloc(device, sizeof(*bview), 8,
-                            VK_SYSTEM_ALLOC_TYPE_API_OBJECT);
-   if (bview == NULL)
-      return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
-
-   *bview = (struct anv_buffer_view) {
-      .bo = buffer->bo,
-      .offset = buffer->offset + pCreateInfo->offset,
-      .surface_state = anv_state_pool_alloc(&device->surface_state_pool, 64, 64),
-      .format = anv_format_for_vk_format(pCreateInfo->format),
-      .range = pCreateInfo->range,
-   };
-
-   *bview_out = bview;
-
-   return VK_SUCCESS;
+   stub_return(VK_UNSUPPORTED);
 }
 
 void anv_DestroyBufferView(
     VkDevice                                    _device,
     VkBufferView                                _bview)
 {
-   ANV_FROM_HANDLE(anv_device, device, _device);
-   ANV_FROM_HANDLE(anv_buffer_view, bview, _bview);
-
-   anv_state_pool_free(&device->surface_state_pool, bview->surface_state);
-   anv_device_free(device, bview);
+   stub();
 }
 
 void anv_DestroySampler(
index 8000e9f53969e6ab1cb69452c753a45758742f6e..25f88fc8b84bd3a371e67499ad808df9a5502025 100644 (file)
@@ -726,7 +726,6 @@ struct anv_descriptor_set_layout {
 
 enum anv_descriptor_type {
    ANV_DESCRIPTOR_TYPE_EMPTY = 0,
-   ANV_DESCRIPTOR_TYPE_BUFFER_VIEW,
    ANV_DESCRIPTOR_TYPE_BUFFER_AND_OFFSET,
    ANV_DESCRIPTOR_TYPE_IMAGE_VIEW,
    ANV_DESCRIPTOR_TYPE_SAMPLER,
@@ -739,7 +738,6 @@ struct anv_descriptor {
    union {
       struct {
          union {
-            struct anv_buffer_view *buffer_view;
             struct anv_image_view *image_view;
          };
          struct anv_sampler *sampler;
@@ -1317,14 +1315,6 @@ struct anv_image {
    };
 };
 
-struct anv_buffer_view {
-   struct anv_state surface_state; /**< RENDER_SURFACE_STATE */
-   struct anv_bo *bo;
-   uint32_t offset; /**< Offset into bo. */
-   uint32_t range; /**< VkBufferViewCreateInfo::range */
-   const struct anv_format *format; /**< VkBufferViewCreateInfo::format */
-};
-
 struct anv_image_view {
    const struct anv_image *image; /**< VkImageViewCreateInfo::image */
    const struct anv_format *format; /**< VkImageViewCreateInfo::format */
@@ -1371,10 +1361,6 @@ gen8_image_view_init(struct anv_image_view *iview,
                      const VkImageViewCreateInfo* pCreateInfo,
                      struct anv_cmd_buffer *cmd_buffer);
 
-VkResult anv_buffer_view_create(struct anv_device *device,
-                                const VkBufferViewCreateInfo *pCreateInfo,
-                                struct anv_buffer_view **bview_out);
-
 void anv_fill_buffer_surface_state(struct anv_device *device, void *state,
                                    const struct anv_format *format,
                                    uint32_t offset, uint32_t range);
@@ -1482,7 +1468,6 @@ ANV_DEFINE_HANDLE_CASTS(anv_queue, VkQueue)
 
 ANV_DEFINE_NONDISP_HANDLE_CASTS(anv_cmd_pool, VkCmdPool)
 ANV_DEFINE_NONDISP_HANDLE_CASTS(anv_buffer, VkBuffer)
-ANV_DEFINE_NONDISP_HANDLE_CASTS(anv_buffer_view, VkBufferView);
 ANV_DEFINE_NONDISP_HANDLE_CASTS(anv_descriptor_set, VkDescriptorSet)
 ANV_DEFINE_NONDISP_HANDLE_CASTS(anv_descriptor_set_layout, VkDescriptorSetLayout)
 ANV_DEFINE_NONDISP_HANDLE_CASTS(anv_device_memory, VkDeviceMemory)
index aef97838e17e0723938e09fbc3171d861f757fc7..0d67be4a99b2764e66fd28559d6448aec029b481 100644 (file)
@@ -59,30 +59,6 @@ gen7_fill_buffer_surface_state(void *state, const struct anv_format *format,
    GEN7_RENDER_SURFACE_STATE_pack(NULL, state, &surface_state);
 }
 
-VkResult gen7_CreateBufferView(
-    VkDevice                                    _device,
-    const VkBufferViewCreateInfo*               pCreateInfo,
-    VkBufferView*                               pView)
-{
-   ANV_FROM_HANDLE(anv_device, device, _device);
-   struct anv_buffer_view *bview;
-   VkResult result;
-
-   result = anv_buffer_view_create(device, pCreateInfo, &bview);
-   if (result != VK_SUCCESS)
-      return result;
-
-   const struct anv_format *format =
-      anv_format_for_vk_format(pCreateInfo->format);
-
-   gen7_fill_buffer_surface_state(bview->surface_state.map, format,
-                                  bview->offset, pCreateInfo->range);
-
-   *pView = anv_buffer_view_to_handle(bview);
-
-   return VK_SUCCESS;
-}
-
 static const uint32_t vk_to_gen_tex_filter[] = {
    [VK_TEX_FILTER_NEAREST]                      = MAPFILTER_NEAREST,
    [VK_TEX_FILTER_LINEAR]                       = MAPFILTER_LINEAR
index d9438127f2a845b95c600d61cc7f92e44dc55855..61aede99ad41e2459f1861eb0971187e4ec14a87 100644 (file)
@@ -63,30 +63,6 @@ gen8_fill_buffer_surface_state(void *state, const struct anv_format *format,
    GEN8_RENDER_SURFACE_STATE_pack(NULL, state, &surface_state);
 }
 
-VkResult gen8_CreateBufferView(
-    VkDevice                                    _device,
-    const VkBufferViewCreateInfo*               pCreateInfo,
-    VkBufferView*                               pView)
-{
-   ANV_FROM_HANDLE(anv_device, device, _device);
-   struct anv_buffer_view *bview;
-   VkResult result;
-
-   result = anv_buffer_view_create(device, pCreateInfo, &bview);
-   if (result != VK_SUCCESS)
-      return result;
-
-   const struct anv_format *format =
-      anv_format_for_vk_format(pCreateInfo->format);
-
-   gen8_fill_buffer_surface_state(bview->surface_state.map, format,
-                                  bview->offset, pCreateInfo->range);
-
-   *pView = anv_buffer_view_to_handle(bview);
-
-   return VK_SUCCESS;
-}
-
 static const uint8_t anv_halign[] = {
     [4] = HALIGN4,
     [8] = HALIGN8,