nvk: Stop using nvk_extent4d short names

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27397>
This commit is contained in:
Faith Ekstrand 2024-04-05 19:01:07 -05:00 committed by Marge Bot
parent 1713b02da7
commit c13e7b01f9
6 changed files with 33 additions and 29 deletions

View File

@ -329,7 +329,8 @@ nv9097_nil_image_fill_tic(const struct nil_image *image,
assert(util_format_get_blocksize(image->format) ==
util_format_get_blocksize(view->format));
assert(view->base_level + view->num_levels <= image->num_levels);
assert(view->base_array_layer + view->array_len <= image->extent_px.a);
assert(view->base_array_layer + view->array_len <=
image->extent_px.array_len);
uint32_t th[8] = { };
@ -430,11 +431,13 @@ nvb097_nil_image_fill_tic(struct nv_device_info *dev,
uint64_t layer_address = base_address;
if (view->type == NIL_VIEW_TYPE_3D_SLICED) {
assert(image->num_levels == 1);
assert(view->base_array_layer + view->array_len <= image->extent_px.d);
assert(view->base_array_layer + view->array_len <=
image->extent_px.depth);
layer_address += nil_image_level_z_offset_B(image, view->base_level,
view->base_array_layer);
} else {
assert(view->base_array_layer + view->array_len <= image->extent_px.a);
assert(view->base_array_layer + view->array_len <=
image->extent_px.array_len);
layer_address += view->base_array_layer * image->array_stride_B;
}

View File

@ -197,7 +197,8 @@ nouveau_copy_rect(struct nvk_cmd_buffer *cmd, struct nouveau_copy *copy)
}
assert(copy->extent_el.depth == 1 || copy->extent_el.array_len == 1);
for (unsigned z = 0; z < MAX2(copy->extent_el.d, copy->extent_el.a); z++) {
uint32_t layers = MAX2(copy->extent_el.depth, copy->extent_el.array_len);
for (unsigned z = 0; z < layers; z++) {
VkDeviceSize src_addr = copy->src.base_addr;
VkDeviceSize dst_addr = copy->dst.base_addr;
@ -454,7 +455,7 @@ nvk_CmdCopyBufferToImage2(VkCommandBuffer commandBuffer,
}
nouveau_copy_rect(cmd, &copy);
if (copy2.extent_el.w > 0)
if (copy2.extent_el.width > 0)
nouveau_copy_rect(cmd, &copy2);
vk_foreach_struct_const(ext, region->pNext) {
@ -561,7 +562,7 @@ nvk_CmdCopyImageToBuffer2(VkCommandBuffer commandBuffer,
}
nouveau_copy_rect(cmd, &copy);
if (copy2.extent_el.w > 0)
if (copy2.extent_el.width > 0)
nouveau_copy_rect(cmd, &copy2);
vk_foreach_struct_const(ext, region->pNext) {

View File

@ -707,7 +707,7 @@ nvk_CmdBeginRendering(VkCommandBuffer commandBuffer,
const uint32_t row_stride_el =
level->row_stride_B / util_format_get_blocksize(p_format);
P_NV9097_SET_COLOR_TARGET_WIDTH(p, i, row_stride_el);
P_NV9097_SET_COLOR_TARGET_HEIGHT(p, i, level_extent_sa.h);
P_NV9097_SET_COLOR_TARGET_HEIGHT(p, i, level_extent_sa.height);
const uint8_t ct_format = nil_format_to_color_target(p_format);
P_NV9097_SET_COLOR_TARGET_FORMAT(p, i, ct_format);
@ -740,7 +740,7 @@ nvk_CmdBeginRendering(VkCommandBuffer commandBuffer,
* takes row pitch
*/
P_NV9097_SET_COLOR_TARGET_WIDTH(p, i, pitch);
P_NV9097_SET_COLOR_TARGET_HEIGHT(p, i, level_extent_sa.h);
P_NV9097_SET_COLOR_TARGET_HEIGHT(p, i, level_extent_sa.height);
const uint8_t ct_format = nil_format_to_color_target(p_format);
P_NV9097_SET_COLOR_TARGET_FORMAT(p, i, ct_format);
@ -845,7 +845,7 @@ nvk_CmdBeginRendering(VkCommandBuffer commandBuffer,
P_MTHD(p, NV9097, SET_ZT_SIZE_A);
P_NV9097_SET_ZT_SIZE_A(p, row_stride_el);
P_NV9097_SET_ZT_SIZE_B(p, level_extent_sa.h);
P_NV9097_SET_ZT_SIZE_B(p, level_extent_sa.height);
P_NV9097_SET_ZT_SIZE_C(p, {
.third_dimension = base_array_layer + layer_count,
.control = CONTROL_THIRD_DIMENSION_DEFINES_ARRAY_SIZE,

View File

@ -117,8 +117,8 @@ write_storage_image_view_desc(struct nvk_descriptor_set *set,
const struct nil_extent4d px_extent_sa =
nil_px_extent_sa(view->planes[plane].sample_layout);
desc.sw_log2 = util_logbase2(px_extent_sa.w);
desc.sh_log2 = util_logbase2(px_extent_sa.h);
desc.sw_log2 = util_logbase2(px_extent_sa.width);
desc.sh_log2 = util_logbase2(px_extent_sa.height);
}
write_desc(set, binding, elem, &desc, sizeof(desc));

View File

@ -467,15 +467,15 @@ nvk_fill_sparse_image_fmt_props(VkImageAspectFlags aspects,
struct nil_extent4d sparse_block_extent_px =
nil_sparse_block_extent_px(format, dim, sample_layout);
assert(sparse_block_extent_px.a == 1);
assert(sparse_block_extent_px.array_len == 1);
VkSparseImageFormatProperties sparse_format_props = {
.aspectMask = aspects,
.flags = VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT,
.imageGranularity = {
.width = sparse_block_extent_px.w,
.height = sparse_block_extent_px.h,
.depth = sparse_block_extent_px.d,
.width = sparse_block_extent_px.width,
.height = sparse_block_extent_px.height,
.depth = sparse_block_extent_px.depth,
},
};
@ -598,10 +598,10 @@ nvk_image_init(struct nvk_device *dev,
.dim = vk_image_type_to_nil_dim(pCreateInfo->imageType),
.format = vk_format_to_pipe_format(format),
.extent_px = {
.w = pCreateInfo->extent.width / width_scale,
.h = pCreateInfo->extent.height / height_scale,
.d = pCreateInfo->extent.depth,
.a = pCreateInfo->arrayLayers,
.width = pCreateInfo->extent.width / width_scale,
.height = pCreateInfo->extent.height / height_scale,
.depth = pCreateInfo->extent.depth,
.array_len = pCreateInfo->arrayLayers,
},
.levels = pCreateInfo->mipLevels,
.samples = pCreateInfo->samples,
@ -618,10 +618,10 @@ nvk_image_init(struct nvk_device *dev,
.dim = vk_image_type_to_nil_dim(pCreateInfo->imageType),
.format = PIPE_FORMAT_R32_UINT,
.extent_px = {
.w = pCreateInfo->extent.width,
.h = pCreateInfo->extent.height,
.d = pCreateInfo->extent.depth,
.a = pCreateInfo->arrayLayers,
.width = pCreateInfo->extent.width,
.height = pCreateInfo->extent.height,
.depth = pCreateInfo->extent.depth,
.array_len = pCreateInfo->arrayLayers,
},
.levels = pCreateInfo->mipLevels,
.samples = pCreateInfo->samples,
@ -887,7 +887,7 @@ nvk_fill_sparse_image_memory_reqs(const struct nil_image *nil,
sparse_memory_reqs.imageMipTailOffset = 0;
} else if (nil->mip_tail_first_lod < nil->num_levels) {
sparse_memory_reqs.imageMipTailSize =
nil_image_mip_tail_size_B(nil) * nil->extent_px.a;
nil_image_mip_tail_size_B(nil) * nil->extent_px.array_len;
sparse_memory_reqs.imageMipTailOffset = NVK_MIP_TAIL_START_OFFSET;
} else {
sparse_memory_reqs.imageMipTailSize = 0;

View File

@ -164,10 +164,10 @@ push_add_image_plane_bind(struct push_builder *pb,
const uint32_t tile_size_B = nil_tiling_size_B(plane_tiling);
const struct nil_extent4d bind_extent_px = {
.w = bind->extent.width,
.h = bind->extent.height,
.d = bind->extent.depth,
.a = 1,
.width = bind->extent.width,
.height = bind->extent.height,
.depth = bind->extent.depth,
.array_len = 1,
};
const struct nil_offset4d bind_offset_px = {
.x = bind->offset.x,
@ -350,7 +350,7 @@ push_add_image_plane_mip_tail_bind(struct push_builder *pb,
const uint64_t mip_tail_stride_B = plane->nil.array_stride_B;
const uint64_t whole_mip_tail_size_B =
mip_tail_size_B * plane->nil.extent_px.a;
mip_tail_size_B * plane->nil.extent_px.array_len;
uint64_t plane_offset_B, mem_offset_B, bind_size_B;
if (!next_opaque_bind_plane(bind, whole_mip_tail_size_B, plane->nil.align_B,