nir: Use var->data.mode instead of deref->mode in a few cases

We already have the variable so we know the mode exactly.  Just use that
instead of the deref mode.  If these paths ever have to handle variable
pointers (not likely since they're OpenGL-specific), we can fix them to
handle crazy deref modes then.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6332>
7 files changed