OSDN Git Service

anv: Use isl_format_layout::bs instead of ::bpb
authorChad Versace <chad.versace@intel.com>
Tue, 5 Jan 2016 17:59:07 +0000 (09:59 -0800)
committerChad Versace <chad.versace@intel.com>
Tue, 5 Jan 2016 18:00:39 +0000 (10:00 -0800)
For all formats used by Vulkan, 8 * bs == bpb.
(bs=block_size_in_bytes, bpb=bits_per_block)

src/vulkan/anv_formats.c
src/vulkan/anv_image.c

index a5c015a..d480ee7 100644 (file)
@@ -247,7 +247,7 @@ anv_get_isl_format(VkFormat format, VkImageAspectFlags aspect,
       if (anv_fmt->surface_format == ISL_FORMAT_UNSUPPORTED) {
          return ISL_FORMAT_UNSUPPORTED;
       } else if (tiling == VK_IMAGE_TILING_OPTIMAL &&
-                 !util_is_power_of_two(anv_fmt->isl_layout->bpb)) {
+                 !util_is_power_of_two(anv_fmt->isl_layout->bs)) {
          /* Tiled formats *must* be power-of-two because we need up upload
           * them with the render pipeline.  For 3-channel formats, we fix
           * this by switching them over to RGBX or RGBA formats under the
index bd55089..79c6ba1 100644 (file)
@@ -545,7 +545,7 @@ anv_CreateBufferView(VkDevice _device,
       anv_fill_buffer_surface_state(device, view->surface_state.map,
                                     view->format,
                                     view->offset, pCreateInfo->range,
-                                    format->isl_layout->bpb / 8);
+                                    format->isl_layout->bs);
    } else {
       view->surface_state = (struct anv_state){ 0 };
    }
@@ -560,7 +560,7 @@ anv_CreateBufferView(VkDevice _device,
       anv_fill_buffer_surface_state(device, view->storage_surface_state.map,
                                     storage_format,
                                     view->offset, pCreateInfo->range,
-                                    format->isl_layout->bpb / 8);
+                                    format->isl_layout->bs);
    } else {
       view->storage_surface_state = (struct anv_state){ 0 };
    }
@@ -658,6 +658,6 @@ anv_buffer_view_fill_image_param(struct anv_device *device,
    param->swizzling[0] = 0xff;
    param->swizzling[1] = 0xff;
 
-   param->stride[0] = isl_format_layouts[view->format].bpb / 8;
+   param->stride[0] = isl_format_layouts[view->format].bs;
    param->size[0] = view->range / param->stride[0];
 }