zink: use a better array loop sizing for gfx descriptor program init
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

this will be more consistent if the array is ever resized

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37358>
This commit is contained in:
Mike Blumenkrantz 2025-09-10 15:12:08 -04:00
parent a7c320e652
commit 393958a02e

View file

@ -522,7 +522,8 @@ zink_descriptor_program_init(struct zink_context *ctx, struct zink_program *pg)
}
}
unsigned num_shaders = pg->is_compute ? 1 : ZINK_GFX_SHADER_COUNT;
struct zink_gfx_program *prog;
unsigned num_shaders = pg->is_compute ? 1 : ARRAY_SIZE(prog->shaders);
bool have_push = screen->info.have_KHR_push_descriptor;
/* iterate over the shaders and generate binding/layout/template structs */
for (int i = 0; i < num_shaders; i++) {