anv: Pass an isl_format into fill_buffer_surface_state
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 15 Dec 2015 00:14:20 +0000 (16:14 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 15 Dec 2015 00:14:20 +0000 (16:14 -0800)
src/vulkan/anv_cmd_buffer.c
src/vulkan/anv_device.c
src/vulkan/anv_image.c
src/vulkan/anv_private.h
src/vulkan/gen7_state.c
src/vulkan/gen8_state.c

index 4dc3704ebf336d9197568eecf6d38622dc83d6a4..984b885a4b6696779dc1965bcb045a58994e9721 100644 (file)
@@ -605,7 +605,7 @@ fill_descriptor_buffer_surface_state(struct anv_device *device, void *state,
    }
 
    anv_fill_buffer_surface_state(device, state,
-                                 anv_format_for_vk_format(format),
+                                 anv_format_for_vk_format(format)->surface_format,
                                  offset, range, 1);
 }
 
index 7ddad58cf6f580e95321e5c84df14b7d86b629a7..ff22490785430e15b1e44c794b676ebe56dffb8a 100644 (file)
@@ -1493,7 +1493,7 @@ void anv_DestroyBuffer(
 
 void
 anv_fill_buffer_surface_state(struct anv_device *device, void *state,
-                              const struct anv_format *format,
+                              enum isl_format format,
                               uint32_t offset, uint32_t range, uint32_t stride)
 {
    switch (device->info.gen) {
index dcad2affb2c497cd10dfab9680c05c5eed2ea9bf..659fe80b3200569b6a365d2aa866f028a985e1e7 100644 (file)
@@ -521,7 +521,8 @@ anv_CreateBufferView(VkDevice _device,
    const struct anv_format *format =
       anv_format_for_vk_format(pCreateInfo->format);
 
-   anv_fill_buffer_surface_state(device, view->surface_state.map, format,
+   anv_fill_buffer_surface_state(device, view->surface_state.map,
+                                 format->surface_format,
                                  view->offset, pCreateInfo->range,
                                  format->isl_layout->bpb / 8);
 
index d2b65711fc4092eb6f2e460299fa59d386cc2460..c5ab92c543833a22163fd10f6872b44969c80ee9 100644 (file)
@@ -1524,20 +1524,20 @@ struct anv_buffer_view {
 };
 
 void anv_fill_buffer_surface_state(struct anv_device *device, void *state,
-                                   const struct anv_format *format,
+                                   enum isl_format format,
                                    uint32_t offset, uint32_t range,
                                    uint32_t stride);
 
-void gen7_fill_buffer_surface_state(void *state, const struct anv_format *format,
+void gen7_fill_buffer_surface_state(void *state, enum isl_format format,
                                     uint32_t offset, uint32_t range,
                                     uint32_t stride);
-void gen75_fill_buffer_surface_state(void *state, const struct anv_format *format,
+void gen75_fill_buffer_surface_state(void *state, enum isl_format format,
                                      uint32_t offset, uint32_t range,
                                      uint32_t stride);
-void gen8_fill_buffer_surface_state(void *state, const struct anv_format *format,
+void gen8_fill_buffer_surface_state(void *state, enum isl_format format,
                                     uint32_t offset, uint32_t range,
                                     uint32_t stride);
-void gen9_fill_buffer_surface_state(void *state, const struct anv_format *format,
+void gen9_fill_buffer_surface_state(void *state, enum isl_format format,
                                     uint32_t offset, uint32_t range,
                                     uint32_t stride);
 
index 108ebe7c225637b6aa3411a6399af7d17d79a4c6..f58283f7d05138d330e786600bd8634cbb42d925 100644 (file)
@@ -57,7 +57,7 @@ anv_surftype(const struct anv_image *image, VkImageViewType view_type)
 }
 
 GENX_FUNC(GEN7, GEN75) void
-genX(fill_buffer_surface_state)(void *state, const struct anv_format *format,
+genX(fill_buffer_surface_state)(void *state, enum isl_format format,
                                 uint32_t offset, uint32_t range,
                                 uint32_t stride)
 {
@@ -65,7 +65,7 @@ genX(fill_buffer_surface_state)(void *state, const struct anv_format *format,
 
    struct GENX(RENDER_SURFACE_STATE) surface_state = {
       .SurfaceType                              = SURFTYPE_BUFFER,
-      .SurfaceFormat                            = format->surface_format,
+      .SurfaceFormat                            = format,
       .SurfaceVerticalAlignment                 = VALIGN_4,
       .SurfaceHorizontalAlignment               = HALIGN_4,
       .TiledSurface                             = false,
index aa57073c3e842f756bb55bea33c5b6df19da5621..eee2515e22023d7282be5fe70e05556dfd6a3c58 100644 (file)
@@ -57,7 +57,7 @@ anv_surftype(const struct anv_image *image, VkImageViewType view_type)
 }
 
 void
-genX(fill_buffer_surface_state)(void *state, const struct anv_format *format,
+genX(fill_buffer_surface_state)(void *state, enum isl_format format,
                                 uint32_t offset, uint32_t range, uint32_t stride)
 {
    uint32_t num_elements = range / stride;
@@ -65,7 +65,7 @@ genX(fill_buffer_surface_state)(void *state, const struct anv_format *format,
    struct GENX(RENDER_SURFACE_STATE) surface_state = {
       .SurfaceType = SURFTYPE_BUFFER,
       .SurfaceArray = false,
-      .SurfaceFormat = format->surface_format,
+      .SurfaceFormat = format,
       .SurfaceVerticalAlignment = VALIGN4,
       .SurfaceHorizontalAlignment = HALIGN4,
       .TileMode = LINEAR,