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: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10422>
(cherry picked from commit c7076e03e5)
This commit is contained in:
Icecream95 2021-04-22 07:13:39 +12:00 committed by Eric Engestrom
parent 2e6cf74e63
commit 695def8e07
2 changed files with 2 additions and 2 deletions

View file

@ -211,7 +211,7 @@
"description": "panfrost: Fix shader texture count",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"master_sha": null,
"because_sha": null
},

View file

@ -234,5 +234,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);
}