diff options
author | Chad Versace <[email protected]> | 2015-10-05 16:24:53 -0700 |
---|---|---|
committer | Chad Versace <[email protected]> | 2015-10-05 17:46:04 -0700 |
commit | f0f4dfa9cc1473c5e12eeeb9403f721d5611e905 (patch) | |
tree | 85bda7f2722d8499c7abccf423e0a633f340269e /src/vulkan/gen8_state.c | |
parent | 74193a880f475da40e8c03ff7e772f3a288317a8 (diff) |
vk: Drop anv_surface_view
Push the members of struct anv_surface_view into anv_image_view and
anv_buffer_view, then remove struct anv_surface_view. Observe that
anv_surface_view::range is not needed for anv_image_view, and so was
dropped there.
This prepares for the merge of VkAttachmentView into VkImageView. Remove
the common parent of anv_buffer_view and anv_image_view (that is,
anv_surface_view) will make the merge easier.
Diffstat (limited to 'src/vulkan/gen8_state.c')
-rw-r--r-- | src/vulkan/gen8_state.c | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/src/vulkan/gen8_state.c b/src/vulkan/gen8_state.c index c47d317d2a3..2b820a3177d 100644 --- a/src/vulkan/gen8_state.c +++ b/src/vulkan/gen8_state.c @@ -119,9 +119,8 @@ VkResult gen8_CreateBufferView( const struct anv_format *format = anv_format_for_vk_format(pCreateInfo->format); - gen8_fill_buffer_surface_state(bview->surface_view.surface_state.map, - format, bview->surface_view.offset, - pCreateInfo->range); + gen8_fill_buffer_surface_state(bview->surface_state.map, format, + bview->offset, pCreateInfo->range); *pView = anv_buffer_view_to_handle(bview); @@ -149,7 +148,6 @@ gen8_image_view_init(struct anv_image_view *iview, ANV_FROM_HANDLE(anv_image, image, pCreateInfo->image); const VkImageSubresourceRange *range = &pCreateInfo->subresourceRange; - struct anv_surface_view *sview = &iview->surface_view; struct anv_surface *surface = anv_image_get_surface_for_aspect_mask(image, range->aspectMask); @@ -162,9 +160,9 @@ gen8_image_view_init(struct anv_image_view *iview, const struct anv_image_view_info view_type_info = anv_image_view_info_for_vk_image_view_type(pCreateInfo->viewType); - sview->bo = image->bo; - sview->offset = image->offset + surface->offset; - sview->format = format_info; + iview->bo = image->bo; + iview->offset = image->offset + surface->offset; + iview->format = format_info; iview->extent = (VkExtent3D) { .width = anv_minify(image->extent.width, range->baseMipLevel), @@ -267,18 +265,18 @@ gen8_image_view_init(struct anv_image_view *iview, .ShaderChannelSelectBlue = vk_to_gen_swizzle[pCreateInfo->channels.b], .ShaderChannelSelectAlpha = vk_to_gen_swizzle[pCreateInfo->channels.a], .ResourceMinLOD = 0.0, - .SurfaceBaseAddress = { NULL, sview->offset }, + .SurfaceBaseAddress = { NULL, iview->offset }, }; if (cmd_buffer) { - sview->surface_state = + iview->surface_state = anv_state_stream_alloc(&cmd_buffer->surface_state_stream, 64, 64); } else { - sview->surface_state = + iview->surface_state = anv_state_pool_alloc(&device->surface_state_pool, 64, 64); } - GEN8_RENDER_SURFACE_STATE_pack(NULL, sview->surface_state.map, + GEN8_RENDER_SURFACE_STATE_pack(NULL, iview->surface_state.map, &surface_state); } @@ -290,7 +288,7 @@ gen8_color_attachment_view_init(struct anv_color_attachment_view *cview, { ANV_FROM_HANDLE(anv_image, image, pCreateInfo->image); struct anv_attachment_view *aview = &cview->attachment_view; - struct anv_surface_view *sview = &cview->surface_view; + struct anv_image_view *iview = &cview->image_view; struct anv_surface *surface = anv_image_get_surface_for_color_attachment(image); const struct anv_format *format_info = @@ -305,9 +303,9 @@ gen8_color_attachment_view_init(struct anv_color_attachment_view *cview, anv_assert(pCreateInfo->mipLevel < image->levels); anv_assert(pCreateInfo->baseArraySlice + pCreateInfo->arraySize <= image->array_size); - sview->bo = image->bo; - sview->offset = image->offset + surface->offset; - sview->format = anv_format_for_vk_format(pCreateInfo->format); + iview->bo = image->bo; + iview->offset = image->offset + surface->offset; + iview->format = anv_format_for_vk_format(pCreateInfo->format); aview->extent = (VkExtent3D) { .width = anv_minify(image->extent.width, pCreateInfo->mipLevel), @@ -355,10 +353,10 @@ gen8_color_attachment_view_init(struct anv_color_attachment_view *cview, } if (cmd_buffer) { - sview->surface_state = + iview->surface_state = anv_state_stream_alloc(&cmd_buffer->surface_state_stream, 64, 64); } else { - sview->surface_state = + iview->surface_state = anv_state_pool_alloc(&device->surface_state_pool, 64, 64); } @@ -411,10 +409,10 @@ gen8_color_attachment_view_init(struct anv_color_attachment_view *cview, .ShaderChannelSelectBlue = SCS_BLUE, .ShaderChannelSelectAlpha = SCS_ALPHA, .ResourceMinLOD = 0.0, - .SurfaceBaseAddress = { NULL, sview->offset }, + .SurfaceBaseAddress = { NULL, iview->offset }, }; - GEN8_RENDER_SURFACE_STATE_pack(NULL, sview->surface_state.map, + GEN8_RENDER_SURFACE_STATE_pack(NULL, iview->surface_state.map, &surface_state); } |