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)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user