mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-28 10:20:09 +01:00
vk: Return anv_image_view_info by value
The struct is only 2 bytes. Returning it on the stack is better than returning a reference into the ELF .data segment.
This commit is contained in:
parent
4ffb4549e0
commit
8bf021cf3d
4 changed files with 7 additions and 7 deletions
|
|
@ -61,10 +61,10 @@ anv_image_view_info_table[] = {
|
|||
#undef INFO
|
||||
};
|
||||
|
||||
const struct anv_image_view_info *
|
||||
struct anv_image_view_info
|
||||
anv_image_view_info_for_vk_image_view_type(VkImageViewType type)
|
||||
{
|
||||
return &anv_image_view_info_table[type];
|
||||
return anv_image_view_info_table[type];
|
||||
}
|
||||
|
||||
static const struct anv_surf_type_limits {
|
||||
|
|
|
|||
|
|
@ -1154,7 +1154,7 @@ struct anv_image_view_info {
|
|||
bool is_cube:1; /**< RENDER_SURFACE_STATE.CubeFaceEnable* */
|
||||
};
|
||||
|
||||
const struct anv_image_view_info *
|
||||
struct anv_image_view_info
|
||||
anv_image_view_info_for_vk_image_view_type(VkImageViewType type);
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -279,7 +279,7 @@ gen7_image_view_init(struct anv_image_view *iview,
|
|||
const struct anv_format *format =
|
||||
anv_format_for_vk_format(pCreateInfo->format);
|
||||
|
||||
const struct anv_image_view_info *view_type_info =
|
||||
const struct anv_image_view_info view_type_info =
|
||||
anv_image_view_info_for_vk_image_view_type(pCreateInfo->viewType);
|
||||
|
||||
if (pCreateInfo->viewType != VK_IMAGE_VIEW_TYPE_2D)
|
||||
|
|
@ -303,7 +303,7 @@ gen7_image_view_init(struct anv_image_view *iview,
|
|||
}
|
||||
|
||||
struct GEN7_RENDER_SURFACE_STATE surface_state = {
|
||||
.SurfaceType = view_type_info->surface_type,
|
||||
.SurfaceType = view_type_info.surface_type,
|
||||
.SurfaceArray = image->array_size > 1,
|
||||
.SurfaceFormat = format->surface_format,
|
||||
.SurfaceVerticalAlignment = anv_valign[surface->v_align],
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@ gen8_image_view_init(struct anv_image_view *iview,
|
|||
const struct anv_format *format_info =
|
||||
anv_format_for_vk_format(pCreateInfo->format);
|
||||
|
||||
const struct anv_image_view_info *view_type_info =
|
||||
const struct anv_image_view_info view_type_info =
|
||||
anv_image_view_info_for_vk_image_view_type(pCreateInfo->viewType);
|
||||
|
||||
view->bo = image->bo;
|
||||
|
|
@ -220,7 +220,7 @@ gen8_image_view_init(struct anv_image_view *iview,
|
|||
};
|
||||
|
||||
struct GEN8_RENDER_SURFACE_STATE surface_state = {
|
||||
.SurfaceType = view_type_info->surface_type,
|
||||
.SurfaceType = view_type_info.surface_type,
|
||||
.SurfaceArray = image->array_size > 1,
|
||||
.SurfaceFormat = format_info->surface_format,
|
||||
.SurfaceVerticalAlignment = anv_valign[surface->v_align],
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue