tu: Use common vk_image_view base struct
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17378>
This commit is contained in:
parent
89263fde20
commit
b90d628a7d
|
@ -161,8 +161,9 @@ tu_cs_image_flag_ref(struct tu_cs *cs, const struct fdl6_view *iview, uint32_t l
|
||||||
tu_cs_emit(cs, iview->FLAG_BUFFER_PITCH);
|
tu_cs_emit(cs, iview->FLAG_BUFFER_PITCH);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
tu_image_view_init(struct tu_image_view *iview,
|
tu_image_view_init(struct tu_device *device,
|
||||||
|
struct tu_image_view *iview,
|
||||||
const VkImageViewCreateInfo *pCreateInfo,
|
const VkImageViewCreateInfo *pCreateInfo,
|
||||||
bool has_z24uint_s8uint)
|
bool has_z24uint_s8uint)
|
||||||
{
|
{
|
||||||
|
@ -176,11 +177,9 @@ tu_image_view_init(struct tu_image_view *iview,
|
||||||
const struct tu_sampler_ycbcr_conversion *conversion = ycbcr_conversion ?
|
const struct tu_sampler_ycbcr_conversion *conversion = ycbcr_conversion ?
|
||||||
tu_sampler_ycbcr_conversion_from_handle(ycbcr_conversion->conversion) : NULL;
|
tu_sampler_ycbcr_conversion_from_handle(ycbcr_conversion->conversion) : NULL;
|
||||||
|
|
||||||
const struct VkImageViewMinLodCreateInfoEXT *min_lod =
|
vk_image_view_init(&device->vk, &iview->vk, false, pCreateInfo);
|
||||||
vk_find_struct_const(pCreateInfo->pNext, IMAGE_VIEW_MIN_LOD_CREATE_INFO_EXT);
|
|
||||||
|
|
||||||
iview->image = image;
|
iview->image = image;
|
||||||
iview->format = pCreateInfo->format;
|
|
||||||
|
|
||||||
const struct fdl_layout *layouts[3];
|
const struct fdl_layout *layouts[3];
|
||||||
|
|
||||||
|
@ -218,7 +217,7 @@ tu_image_view_init(struct tu_image_view *iview,
|
||||||
args.base_miplevel = range->baseMipLevel;
|
args.base_miplevel = range->baseMipLevel;
|
||||||
args.layer_count = vk_image_subresource_layer_count(&image->vk, range);
|
args.layer_count = vk_image_subresource_layer_count(&image->vk, range);
|
||||||
args.level_count = vk_image_subresource_level_count(&image->vk, range);
|
args.level_count = vk_image_subresource_level_count(&image->vk, range);
|
||||||
args.min_lod_clamp = min_lod ? min_lod->minLod : 0.f;
|
args.min_lod_clamp = iview->vk.min_lod;
|
||||||
args.format = tu_format_for_aspect(format, aspect_mask);
|
args.format = tu_format_for_aspect(format, aspect_mask);
|
||||||
vk_component_mapping_to_pipe_swizzle(pCreateInfo->components, args.swiz);
|
vk_component_mapping_to_pipe_swizzle(pCreateInfo->components, args.swiz);
|
||||||
if (conversion) {
|
if (conversion) {
|
||||||
|
@ -804,7 +803,7 @@ tu_CreateImageView(VkDevice _device,
|
||||||
if (view == NULL)
|
if (view == NULL)
|
||||||
return vk_error(device, VK_ERROR_OUT_OF_HOST_MEMORY);
|
return vk_error(device, VK_ERROR_OUT_OF_HOST_MEMORY);
|
||||||
|
|
||||||
tu_image_view_init(view, pCreateInfo, device->use_z24uint_s8uint);
|
tu_image_view_init(device, view, pCreateInfo, device->use_z24uint_s8uint);
|
||||||
|
|
||||||
*pView = tu_image_view_to_handle(view);
|
*pView = tu_image_view_to_handle(view);
|
||||||
|
|
||||||
|
|
|
@ -951,7 +951,7 @@ static void
|
||||||
tu_setup_dynamic_attachment(struct tu_render_pass_attachment *att,
|
tu_setup_dynamic_attachment(struct tu_render_pass_attachment *att,
|
||||||
struct tu_image_view *view)
|
struct tu_image_view *view)
|
||||||
{
|
{
|
||||||
att->format = view->format;
|
att->format = view->vk.format;
|
||||||
att->samples = view->image->layout->nr_samples;
|
att->samples = view->image->layout->nr_samples;
|
||||||
|
|
||||||
/* for d32s8, cpp is for the depth image, and
|
/* for d32s8, cpp is for the depth image, and
|
||||||
|
@ -1006,7 +1006,7 @@ tu_setup_dynamic_render_pass(struct tu_cmd_buffer *cmd_buffer,
|
||||||
|
|
||||||
subpass->samples = view->image->layout->nr_samples;
|
subpass->samples = view->image->layout->nr_samples;
|
||||||
|
|
||||||
if (vk_format_is_srgb(view->format))
|
if (vk_format_is_srgb(view->vk.format))
|
||||||
subpass->srgb_cntl |= 1 << i;
|
subpass->srgb_cntl |= 1 << i;
|
||||||
|
|
||||||
if (att_info->resolveMode != VK_RESOLVE_MODE_NONE) {
|
if (att_info->resolveMode != VK_RESOLVE_MODE_NONE) {
|
||||||
|
|
|
@ -2100,12 +2100,10 @@ enum pipe_format tu_format_for_aspect(enum pipe_format format,
|
||||||
|
|
||||||
struct tu_image_view
|
struct tu_image_view
|
||||||
{
|
{
|
||||||
struct vk_object_base base;
|
struct vk_image_view vk;
|
||||||
|
|
||||||
struct tu_image *image; /**< VkImageViewCreateInfo::image */
|
struct tu_image *image; /**< VkImageViewCreateInfo::image */
|
||||||
|
|
||||||
VkFormat format;
|
|
||||||
|
|
||||||
struct fdl6_view view;
|
struct fdl6_view view;
|
||||||
|
|
||||||
/* for d32s8 separate depth */
|
/* for d32s8 separate depth */
|
||||||
|
@ -2170,11 +2168,6 @@ tu_import_memory_from_gralloc_handle(VkDevice device_h,
|
||||||
const VkAllocationCallbacks *alloc,
|
const VkAllocationCallbacks *alloc,
|
||||||
VkImage image_h);
|
VkImage image_h);
|
||||||
|
|
||||||
void
|
|
||||||
tu_image_view_init(struct tu_image_view *iview,
|
|
||||||
const VkImageViewCreateInfo *pCreateInfo,
|
|
||||||
bool limited_z24s8);
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
tiling_possible(VkFormat format);
|
tiling_possible(VkFormat format);
|
||||||
|
|
||||||
|
@ -2350,7 +2343,7 @@ VK_DEFINE_NONDISP_HANDLE_CASTS(tu_event, base, VkEvent, VK_OBJECT_TYPE_EVENT)
|
||||||
VK_DEFINE_NONDISP_HANDLE_CASTS(tu_framebuffer, base, VkFramebuffer,
|
VK_DEFINE_NONDISP_HANDLE_CASTS(tu_framebuffer, base, VkFramebuffer,
|
||||||
VK_OBJECT_TYPE_FRAMEBUFFER)
|
VK_OBJECT_TYPE_FRAMEBUFFER)
|
||||||
VK_DEFINE_NONDISP_HANDLE_CASTS(tu_image, vk.base, VkImage, VK_OBJECT_TYPE_IMAGE)
|
VK_DEFINE_NONDISP_HANDLE_CASTS(tu_image, vk.base, VkImage, VK_OBJECT_TYPE_IMAGE)
|
||||||
VK_DEFINE_NONDISP_HANDLE_CASTS(tu_image_view, base, VkImageView,
|
VK_DEFINE_NONDISP_HANDLE_CASTS(tu_image_view, vk.base, VkImageView,
|
||||||
VK_OBJECT_TYPE_IMAGE_VIEW);
|
VK_OBJECT_TYPE_IMAGE_VIEW);
|
||||||
VK_DEFINE_NONDISP_HANDLE_CASTS(tu_pipeline_cache, base, VkPipelineCache,
|
VK_DEFINE_NONDISP_HANDLE_CASTS(tu_pipeline_cache, base, VkPipelineCache,
|
||||||
VK_OBJECT_TYPE_PIPELINE_CACHE)
|
VK_OBJECT_TYPE_PIPELINE_CACHE)
|
||||||
|
|
Loading…
Reference in New Issue