From 89b68dc8d09a41fc719cbdf7a5bff42476601dab Mon Sep 17 00:00:00 2001 From: Chad Versace Date: Tue, 5 Jan 2016 09:59:07 -0800 Subject: [PATCH] anv: Use isl_format_layout::bs instead of ::bpb For all formats used by Vulkan, 8 * bs == bpb. (bs=block_size_in_bytes, bpb=bits_per_block) --- src/vulkan/anv_formats.c | 2 +- src/vulkan/anv_image.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/vulkan/anv_formats.c b/src/vulkan/anv_formats.c index a5c015ada08..d480ee7cb9d 100644 --- a/src/vulkan/anv_formats.c +++ b/src/vulkan/anv_formats.c @@ -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 diff --git a/src/vulkan/anv_image.c b/src/vulkan/anv_image.c index bd550890596..79c6ba15a03 100644 --- a/src/vulkan/anv_image.c +++ b/src/vulkan/anv_image.c @@ -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]; } -- 2.30.2