isl/state: Put surface format setup at the top
authorJason Ekstrand <jason.ekstrand@intel.com>
Wed, 8 Jun 2016 00:14:39 +0000 (17:14 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Wed, 22 Jun 2016 19:26:43 +0000 (12:26 -0700)
This is purely cosmetic, but it makes things look a bit more readable.

Reviewed-by: Chad Versace <chad.versace@intel.com>
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
src/intel/isl/isl_surface_state.c

index c36ef3bbd5ab43ba66f9f7277eee41c7190fdaae..0f21e34b17a796619bdf988f945c627a52e489d4 100644 (file)
@@ -206,6 +206,13 @@ isl_genX(surf_fill_state_s)(const struct isl_device *dev, void *state,
 
    s.SurfaceType = get_surftype(info->surf->dim, info->view->usage);
 
+   if (info->view->usage & ISL_SURF_USAGE_STORAGE_BIT) {
+      s.SurfaceFormat =
+         isl_lower_storage_image_format(dev->info, info->view->format);
+   } else {
+      s.SurfaceFormat = info->view->format;
+   }
+
    s.SurfaceArray = info->surf->phys_level0_sa.array_len > 1;
    s.SurfaceVerticalAlignment = valign;
    s.SurfaceHorizontalAlignment = halign;
@@ -291,13 +298,6 @@ isl_genX(surf_fill_state_s)(const struct isl_device *dev, void *state,
       s.SurfacePitch = info->surf->row_pitch - 1;
    }
 
-   if (info->view->usage & ISL_SURF_USAGE_STORAGE_BIT) {
-      s.SurfaceFormat =
-         isl_lower_storage_image_format(dev->info, info->view->format);
-   } else {
-      s.SurfaceFormat = info->view->format;
-   }
-
    switch (s.SurfaceType) {
    case SURFTYPE_1D:
    case SURFTYPE_2D: