nvk: Implement VK_EXT_image_view_min_lod

Closes: https://gitlab.freedesktop.org/nouveau/mesa/-/issues/40

Signed-off-by: Rebecca Mckeever <rebecca.mckeever@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
This commit is contained in:
Rebecca Mckeever
2022-12-21 13:01:04 -06:00
committed by Marge Bot
parent 71da9cbefb
commit 70ce8ba5a4
4 changed files with 16 additions and 0 deletions
+3
View File
@@ -178,6 +178,9 @@ struct nil_view {
uint32_t array_len;
enum pipe_swizzle swizzle[4];
/* VK_EXT_image_view_min_lod */
float min_lod_clamp;
};
bool nil_image_init(struct nv_device_info *dev,
+6
View File
@@ -370,6 +370,9 @@ nv9097_nil_image_fill_tic(const struct nil_image *image,
TH_NV9097_SET_U(th, 7, MULTI_SAMPLE_COUNT,
nil_to_nv9097_multi_sample_count(image->sample_layout));
TH_NV9097_SET_UF(th, 7, MIN_LOD_CLAMP,
view->min_lod_clamp - view->base_level);
memcpy(desc_out, th, sizeof(th));
}
@@ -444,6 +447,9 @@ nvb097_nil_image_fill_tic(const struct nil_image *image,
TH_NVB097_SET_U(th, BL, MULTI_SAMPLE_COUNT,
nil_to_nvb097_multi_sample_count(image->sample_layout));
TH_NVB097_SET_UF(th, BL, MIN_LOD_CLAMP,
view->min_lod_clamp - view->base_level);
memcpy(desc_out, th, sizeof(th));
}
+1
View File
@@ -97,6 +97,7 @@ nvk_image_view_init(struct nvk_device *device,
vk_swizzle_to_pipe(view->vk.swizzle.b),
vk_swizzle_to_pipe(view->vk.swizzle.a),
},
.min_lod_clamp = view->vk.min_lod,
};
if (nil_image.dim == NIL_IMAGE_DIM_3D &&
+6
View File
@@ -198,6 +198,11 @@ nvk_GetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice,
f->sampler2DViewOf3D = true;
break;
}
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_MIN_LOD_FEATURES_EXT: {
VkPhysicalDeviceImageViewMinLodFeaturesEXT *f = (void *)ext;
f->minLod = true;
break;
}
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INDEX_TYPE_UINT8_FEATURES_EXT: {
VkPhysicalDeviceIndexTypeUint8FeaturesEXT *f = (void *)ext;
f->indexTypeUint8 = true;
@@ -479,6 +484,7 @@ nvk_get_device_extensions(const struct nvk_physical_device *pdev,
.EXT_extended_dynamic_state3 = true,
.EXT_host_query_reset = true,
.EXT_image_2d_view_of_3d = true,
.EXT_image_view_min_lod = true,
.EXT_index_type_uint8 = true,
.EXT_inline_uniform_block = true,
.EXT_non_seamless_cube_map = true,