In the NIR domain, some texture operations don't require a sampler, but
Bifrost/Midgard always want one. Let's add a dummy sampler to handle
that case.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15334>
layout->num_dyn_ssbos = dyn_ssbo_idx;
layout->num_imgs = img_idx;
+ /* Some NIR texture operations don't require a sampler, but Bifrost/Midgard
+ * ones always expect one. Add a dummy sampler to deal with this limitation.
+ */
+ if (layout->num_textures) {
+ layout->num_samplers++;
+ for (unsigned set = 0; set < pCreateInfo->setLayoutCount; set++)
+ layout->sets[set].sampler_offset++;
+ }
+
_mesa_sha1_final(&ctx, layout->sha1);
*pPipelineLayout = panvk_pipeline_layout_to_handle(layout);
void *sampler = samplers.cpu;
+ /* Prepare the dummy sampler */
+ pan_pack(sampler, SAMPLER, cfg) {
+#if PAN_ARCH >= 6
+ cfg.seamless_cube_map = false;
+#endif
+ cfg.magnify_nearest = true;
+ cfg.minify_nearest = true;
+ cfg.normalized_coordinates = false;
+ }
+
+ sampler += pan_size(SAMPLER);
+
for (unsigned i = 0; i < ARRAY_SIZE(desc_state->sets); i++) {
if (!desc_state->sets[i]) continue;