Mesa (main): anv: Don't use the wrong ARRAY_SIZE
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Jul 19 03:28:38 UTC 2022
Module: Mesa
Branch: main
Commit: cb682a1cdd0485df9bb842b33fdb0f0d37f9c206
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=cb682a1cdd0485df9bb842b33fdb0f0d37f9c206
Author: Jason Ekstrand <jason.ekstrand at collabora.com>
Date: Fri Jul 15 05:19:12 2022 -0500
anv: Don't use the wrong ARRAY_SIZE
Even though this doesn't change anything, it's not good to use an
ARRAY_SIZE for one array to iterate over another.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17601>
---
src/intel/vulkan/anv_pipeline.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_pipeline.c
index dbbfc9540ed..c45954cd3eb 100644
--- a/src/intel/vulkan/anv_pipeline.c
+++ b/src/intel/vulkan/anv_pipeline.c
@@ -577,7 +577,7 @@ anv_pipeline_hash_graphics(struct anv_graphics_pipeline *pipeline,
const bool rba = pipeline->base.device->robust_buffer_access;
_mesa_sha1_update(&ctx, &rba, sizeof(rba));
- for (unsigned s = 0; s < ARRAY_SIZE(pipeline->shaders); s++) {
+ for (uint32_t s = 0; s < ANV_GRAPHICS_SHADER_STAGE_COUNT; s++) {
if (stages[s].info) {
_mesa_sha1_update(&ctx, stages[s].shader_sha1,
sizeof(stages[s].shader_sha1));
More information about the mesa-commit
mailing list