diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.c b/src/gallium/auxiliary/tgsi/tgsi_exec.c index f7ed64121f0..e2ed18d6049 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_exec.c +++ b/src/gallium/auxiliary/tgsi/tgsi_exec.c @@ -1461,7 +1461,7 @@ fetch_src_file_channel(const struct tgsi_exec_machine *mach, const uint constbuf = index2D->i[i]; const int pos = index->i[i] * 4 + swizzle; /* const buffer bounds check */ - if (pos < 0 || pos >= (int) mach->ConstsSize[constbuf]) { + if (pos < 0 || pos >= (int) mach->ConstsSize[constbuf] / 4) { if (0) { /* Debug: print warning */ static int count = 0;