From c7076e03e51bc578f61286ac4f4b91635aa3667e Mon Sep 17 00:00:00 2001 From: Icecream95 Date: Thu, 22 Apr 2021 07:13:39 +1200 Subject: [PATCH] panfrost: Fix shader texture count Instead of using num_textures, determine the texture count from the last bit set in textures_used. Fixes ADDR_RANGE_FAULTs when draw_textured_quad writes only stencil. Cc: mesa-stable Part-of: --- src/panfrost/lib/pan_shader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/panfrost/lib/pan_shader.c b/src/panfrost/lib/pan_shader.c index 8a42e29bc9e..49bba06ce45 100644 --- a/src/panfrost/lib/pan_shader.c +++ b/src/panfrost/lib/pan_shader.c @@ -239,5 +239,5 @@ pan_shader_compile(const struct panfrost_device *dev, info->attribute_count += util_bitcount(s->info.images_used); info->writes_global = s->info.writes_memory; - info->sampler_count = info->texture_count = s->info.num_textures; + info->sampler_count = info->texture_count = BITSET_LAST_BIT(s->info.textures_used); }