panvk: Disable integer array indices clamping

This is required to support VK_EXT_image_robustness properly as
otherwise the array index would be clamped to the array size on
TEX_FETCH and would not end up returning zeroes as expected by
the extension.

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32331>
This commit is contained in:
Mary Guillemard 2024-11-25 17:50:24 +01:00 committed by Marge Bot
parent f9c39ceaf5
commit bacdf351f6
5 changed files with 11 additions and 4 deletions

View file

@ -51,7 +51,8 @@ prepare_driver_set(struct panvk_cmd_buffer *cmdbuf)
return VK_ERROR_OUT_OF_DEVICE_MEMORY;
/* Dummy sampler always comes first. */
pan_pack(&descs[0], SAMPLER, _) {
pan_pack(&descs[0], SAMPLER, cfg) {
cfg.clamp_integer_array_indices = false;
}
panvk_per_arch(cmd_fill_dyn_bufs)(desc_state, cs,

View file

@ -160,7 +160,8 @@ prepare_vs_driver_set(struct panvk_cmd_buffer *cmdbuf)
}
/* Dummy sampler always comes right after the vertex attribs. */
pan_pack(&descs[MAX_VS_ATTRIBS], SAMPLER, _) {
pan_pack(&descs[MAX_VS_ATTRIBS], SAMPLER, cfg) {
cfg.clamp_integer_array_indices = false;
}
panvk_per_arch(cmd_fill_dyn_bufs)(
@ -203,7 +204,8 @@ prepare_fs_driver_set(struct panvk_cmd_buffer *cmdbuf)
return VK_ERROR_OUT_OF_DEVICE_MEMORY;
/* Dummy sampler always comes first. */
pan_pack(&descs[0], SAMPLER, _) {
pan_pack(&descs[0], SAMPLER, cfg) {
cfg.clamp_integer_array_indices = false;
}
panvk_per_arch(cmd_fill_dyn_bufs)(desc_state, fs,

View file

@ -234,7 +234,8 @@ panvk_per_arch(cmd_prepare_shader_desc_tables)(
return VK_ERROR_OUT_OF_DEVICE_MEMORY;
/* Emit a dummy sampler if we have to. */
pan_pack(sampler.cpu, SAMPLER, _) {
pan_pack(sampler.cpu, SAMPLER, cfg) {
cfg.clamp_integer_array_indices = false;
}
shader_desc_state->tables[PANVK_BIFROST_DESC_TABLE_SAMPLER] = sampler.gpu;

View file

@ -428,6 +428,7 @@ cmd_emit_dcd(struct panvk_cmd_buffer *cmdbuf,
pan_pack(sampler.cpu, SAMPLER, cfg) {
cfg.seamless_cube_map = false;
cfg.normalized_coordinates = false;
cfg.clamp_integer_array_indices = false;
cfg.minify_nearest = true;
cfg.magnify_nearest = true;
}
@ -558,6 +559,7 @@ cmd_emit_dcd(struct panvk_cmd_buffer *cmdbuf,
pan_pack(sampler, SAMPLER, cfg) {
cfg.seamless_cube_map = false;
cfg.normalized_coordinates = false;
cfg.clamp_integer_array_indices = false;
cfg.minify_nearest = true;
cfg.magnify_nearest = true;
}

View file

@ -106,6 +106,7 @@ panvk_per_arch(CreateSampler)(VkDevice _device,
cfg.mipmap_mode =
panvk_translate_sampler_mipmap_mode(pCreateInfo->mipmapMode);
cfg.normalized_coordinates = !pCreateInfo->unnormalizedCoordinates;
cfg.clamp_integer_array_indices = false;
cfg.lod_bias = pCreateInfo->mipLodBias;
cfg.minimum_lod = pCreateInfo->minLod;