nil: Drop the nil_extent/offset4d() helpers

They're only used one place each in NVK and we can just use a struct
initializer instead.

Reviewed-by: Lina Versace <linyaa@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28639>
This commit is contained in:
Faith Ekstrand
2024-04-08 14:58:37 -05:00
committed by Marge Bot
parent bc0de7a2cf
commit 5a075785ac
2 changed files with 12 additions and 22 deletions
-20
View File
@@ -15,21 +15,6 @@ pub struct Extent4D {
pub array_len: u32,
}
#[no_mangle]
pub extern "C" fn nil_extent4d(
width: u32,
height: u32,
depth: u32,
array_len: u32,
) -> Extent4D {
Extent4D {
width,
height,
depth,
array_len,
}
}
impl Extent4D {
pub fn new(
width: u32,
@@ -145,11 +130,6 @@ pub struct Offset4D {
pub a: u32,
}
#[no_mangle]
pub extern "C" fn nil_offset4d(x: u32, y: u32, z: u32, a: u32) -> Offset4D {
Offset4D { x, y, z, a }
}
impl Offset4D {
fn div_floor(self, other: Extent4D) -> Self {
Self {
+12 -2
View File
@@ -68,13 +68,23 @@ nouveau_copy_rect_buffer(struct nvk_buffer *buf,
static struct nil_offset4d
vk_to_nil_offset(VkOffset3D offset, uint32_t base_array_layer)
{
return nil_offset4d(offset.x, offset.y, offset.z, base_array_layer);
return (struct nil_offset4d) {
.x = offset.x,
.y = offset.y,
.z = offset.z,
.a = base_array_layer
};
}
static struct nil_extent4d
vk_to_nil_extent(VkExtent3D extent, uint32_t array_layers)
{
return nil_extent4d(extent.width, extent.height, extent.depth, array_layers);
return (struct nil_extent4d) {
.width = extent.width,
.height = extent.height,
.depth = extent.depth,
.array_len = array_layers,
};
}
static struct nouveau_copy_buffer