vk/image: Drop some tmp vars in anv_image_view_init()
authorChad Versace <chad.versace@intel.com>
Sat, 27 Jun 2015 02:50:04 +0000 (19:50 -0700)
committerChad Versace <chad.versace@intel.com>
Sat, 27 Jun 2015 02:50:04 +0000 (19:50 -0700)
Variables 'tile_mode' and 'format' are unneeded.

src/vulkan/image.c

index dc05b694c8ad729ab31032647d53cd2e62e221f4..b55fb9fde5c4b3790caeca9bb7be0e04a04a7e0d 100644 (file)
@@ -264,9 +264,9 @@ anv_image_view_init(struct anv_surface_view *view,
                     struct anv_cmd_buffer *cmd_buffer)
 {
    struct anv_image *image = (struct anv_image *) pCreateInfo->image;
-   const struct anv_format *info =
+
+   const struct anv_format *format_info =
       anv_format_for_vk_format(pCreateInfo->format);
-   uint32_t tile_mode, format;
 
    /* XXX: We don't handle any of these */
    anv_assert(pCreateInfo->viewType == VK_IMAGE_VIEW_TYPE_2D);
@@ -276,6 +276,7 @@ anv_image_view_init(struct anv_surface_view *view,
    anv_assert(pCreateInfo->subresourceRange.arraySize == 1);
 
    view->bo = image->bo;
+
    switch (pCreateInfo->subresourceRange.aspect) {
    case VK_IMAGE_ASPECT_STENCIL:
       anv_finishme("stencil image views");
@@ -284,8 +285,6 @@ anv_image_view_init(struct anv_surface_view *view,
    case VK_IMAGE_ASPECT_DEPTH:
    case VK_IMAGE_ASPECT_COLOR:
       view->offset = image->offset;
-      tile_mode = image->tile_mode;
-      format = info->surface_format;
       break;
    default:
       unreachable("");
@@ -307,10 +306,10 @@ anv_image_view_init(struct anv_surface_view *view,
    struct GEN8_RENDER_SURFACE_STATE surface_state = {
       .SurfaceType = anv_surf_type_from_image_view_type[pCreateInfo->viewType],
       .SurfaceArray = false,
-      .SurfaceFormat = format,
+      .SurfaceFormat = format_info->surface_format,
       .SurfaceVerticalAlignment = anv_valign[image->v_align],
       .SurfaceHorizontalAlignment = anv_halign[image->h_align],
-      .TileMode = tile_mode,
+      .TileMode = image->tile_mode,
       .VerticalLineStride = 0,
       .VerticalLineStrideOffset = 0,
       .SamplerL2BypassModeDisable = true,