It is perfectly valid for the swizzle to be bigger than 2. For example the
texel offsets could be
SAMPLE ..., IMM[0].zzz
What is not correct is for chan_index to be bigger than 2.
Trivial.
if (chan_index == LP_CHAN_ALL) {
swizzle = ~0;
} else {
+ assert(chan_index < TGSI_SWIZZLE_W);
swizzle = tgsi_util_get_src_register_swizzle(®.Register, chan_index);
- if (swizzle > 2) {
- assert(0 && "invalid swizzle in emit_fetch_texoffset()");
- return bld_base->base.undef;
- }
}
assert(off->Index <= bld_base->info->file_max[off->File]);