From 695def8e078a18be42483437a4be1b7c998dbaee 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: (cherry picked from commit c7076e03e51bc578f61286ac4f4b91635aa3667e) --- .pick_status.json | 2 +- src/panfrost/lib/pan_shader.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 35355c92af6..2c77c17ef5c 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -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 }, diff --git a/src/panfrost/lib/pan_shader.c b/src/panfrost/lib/pan_shader.c index 2f6e30f58a8..5994ff82a6b 100644 --- a/src/panfrost/lib/pan_shader.c +++ b/src/panfrost/lib/pan_shader.c @@ -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); }