instr->has_predicate = false;
src_init(&instr->predicate);
+ instr->sampler_index = 0;
+ instr->sampler_array_size = 0;
+ instr->sampler = NULL;
+
return instr;
}
nir_tex_src_ms_index, /* MSAA sample index */
nir_tex_src_ddx,
nir_tex_src_ddy,
- nir_tex_src_sampler_index, /* < dynamically uniform indirect index */
+ nir_tex_src_sampler_offset, /* < dynamically uniform indirect offset */
nir_num_texinput_types
} nir_texinput_type;
/* gather component selector */
unsigned component : 2;
+ /** The sampler index
+ *
+ * If this texture instruction has a nir_tex_src_sampler_offset source,
+ * then the sampler index is given by sampler_index + sampler_offset.
+ */
unsigned sampler_index;
+
+ /** The size of the sampler array or 0 if it's not an array */
+ unsigned sampler_array_size;
+
nir_deref_var *sampler; /* if this is NULL, use sampler_index instead */
} nir_tex_instr;
case nir_tex_src_ddy:
fprintf(fp, "(ddy)");
break;
- case nir_tex_src_sampler_index:
- fprintf(fp, "(sampler_index)");
+ case nir_tex_src_sampler_offset:
+ fprintf(fp, "(sampler_offset)");
break;
default:
break;
case nir_tex_src_projector:
unreachable("should be lowered");
- case nir_tex_src_sampler_index:
+ case nir_tex_src_sampler_offset:
unreachable("not yet supported");
default:
unreachable("unknown texture source");