case nir_intrinsic_interp_deref_at_offset:
case nir_intrinsic_interp_deref_at_sample:
case nir_intrinsic_interp_deref_at_centroid:
+ case nir_intrinsic_interp_deref_at_vertex:
case nir_intrinsic_load_tess_coord:
case nir_intrinsic_load_point_coord:
case nir_intrinsic_load_frag_coord:
case nir_intrinsic_interp_deref_at_centroid:
case nir_intrinsic_interp_deref_at_sample:
case nir_intrinsic_interp_deref_at_offset:
+ case nir_intrinsic_interp_deref_at_vertex:
case nir_intrinsic_load_deref:
case nir_intrinsic_store_deref:{
nir_deref_instr *deref = nir_src_as_deref(instr->src[0]);
# Interpolation of input. The interp_deref_at* intrinsics are similar to the
# load_var intrinsic acting on a shader input except that they interpolate the
-# input differently. The at_sample and at_offset intrinsics take an
-# additional source that is an integer sample id or a vec2 position offset
-# respectively.
+# input differently. The at_sample, at_offset and at_vertex intrinsics take an
+# additional source that is an integer sample id, a vec2 position offset, or a
+# vertex ID respectively.
intrinsic("interp_deref_at_centroid", dest_comp=0, src_comp=[1],
flags=[ CAN_ELIMINATE, CAN_REORDER])
flags=[CAN_ELIMINATE, CAN_REORDER])
intrinsic("interp_deref_at_offset", src_comp=[1, 2], dest_comp=0,
flags=[CAN_ELIMINATE, CAN_REORDER])
+intrinsic("interp_deref_at_vertex", src_comp=[1, 1], dest_comp=0,
+ flags=[CAN_ELIMINATE, CAN_REORDER])
# Gets the length of an unsized array at the end of a buffer
intrinsic("deref_buffer_array_length", src_comp=[-1], dest_comp=1,
if (intr->intrinsic != nir_intrinsic_load_deref &&
intr->intrinsic != nir_intrinsic_interp_deref_at_centroid &&
intr->intrinsic != nir_intrinsic_interp_deref_at_sample &&
- intr->intrinsic != nir_intrinsic_interp_deref_at_offset)
+ intr->intrinsic != nir_intrinsic_interp_deref_at_offset &&
+ intr->intrinsic != nir_intrinsic_interp_deref_at_vertex)
continue;
nir_deref_instr *deref = nir_src_as_deref(intr->src[0]);
intrin->intrinsic != nir_intrinsic_interp_deref_at_centroid &&
intrin->intrinsic != nir_intrinsic_interp_deref_at_sample &&
intrin->intrinsic != nir_intrinsic_interp_deref_at_offset &&
+ intrin->intrinsic != nir_intrinsic_interp_deref_at_vertex &&
intrin->intrinsic != nir_intrinsic_store_deref)
continue;
intrin->intrinsic != nir_intrinsic_interp_deref_at_centroid &&
intrin->intrinsic != nir_intrinsic_interp_deref_at_sample &&
intrin->intrinsic != nir_intrinsic_interp_deref_at_offset &&
+ intrin->intrinsic != nir_intrinsic_interp_deref_at_vertex &&
intrin->intrinsic != nir_intrinsic_store_deref)
continue;
nir_intrinsic_set_interp_mode(bary_setup, var->data.interpolation);
if (intrin->intrinsic == nir_intrinsic_interp_deref_at_sample ||
- intrin->intrinsic == nir_intrinsic_interp_deref_at_offset)
+ intrin->intrinsic == nir_intrinsic_interp_deref_at_offset ||
+ intrin->intrinsic == nir_intrinsic_interp_deref_at_vertex)
nir_src_copy(&bary_setup->src[0], &intrin->src[1], bary_setup);
nir_builder_instr_insert(b, &bary_setup->instr);
case nir_intrinsic_interp_deref_at_centroid:
case nir_intrinsic_interp_deref_at_sample:
case nir_intrinsic_interp_deref_at_offset:
+ case nir_intrinsic_interp_deref_at_vertex:
/* We can optionally lower these to load_interpolated_input */
if (options->use_interpolated_input_intrinsics)
break;
case nir_intrinsic_interp_deref_at_centroid:
case nir_intrinsic_interp_deref_at_sample:
case nir_intrinsic_interp_deref_at_offset:
+ case nir_intrinsic_interp_deref_at_vertex:
assert(vertex_index == NULL);
replacement = lower_interpolate_at(intrin, state, var, offset,
component_offset, deref->type);
intr->num_components, intr->dest.ssa.bit_size, NULL);
if (intr->intrinsic == nir_intrinsic_interp_deref_at_offset ||
- intr->intrinsic == nir_intrinsic_interp_deref_at_sample) {
+ intr->intrinsic == nir_intrinsic_interp_deref_at_sample ||
+ intr->intrinsic == nir_intrinsic_interp_deref_at_vertex) {
nir_src_copy(&element_intr->src[1], &intr->src[1],
&element_intr->instr);
}
intr->intrinsic != nir_intrinsic_store_deref &&
intr->intrinsic != nir_intrinsic_interp_deref_at_centroid &&
intr->intrinsic != nir_intrinsic_interp_deref_at_sample &&
- intr->intrinsic != nir_intrinsic_interp_deref_at_offset)
+ intr->intrinsic != nir_intrinsic_interp_deref_at_offset &&
+ intr->intrinsic != nir_intrinsic_interp_deref_at_vertex)
continue;
nir_deref_instr *deref = nir_src_as_deref(intr->src[0]);
intr->intrinsic != nir_intrinsic_store_deref &&
intr->intrinsic != nir_intrinsic_interp_deref_at_centroid &&
intr->intrinsic != nir_intrinsic_interp_deref_at_sample &&
- intr->intrinsic != nir_intrinsic_interp_deref_at_offset)
+ intr->intrinsic != nir_intrinsic_interp_deref_at_offset &&
+ intr->intrinsic != nir_intrinsic_interp_deref_at_vertex)
continue;
nir_deref_instr *deref = nir_src_as_deref(intr->src[0]);
case nir_intrinsic_interp_deref_at_centroid:
case nir_intrinsic_interp_deref_at_sample:
case nir_intrinsic_interp_deref_at_offset:
+ case nir_intrinsic_interp_deref_at_vertex:
case nir_intrinsic_load_deref:
case nir_intrinsic_store_deref:
if ((mask & nir_var_shader_in && mode == nir_var_shader_in) ||
chan_intr->src[0] = nir_src_for_ssa(&deref->dest.ssa);
if (intr->intrinsic == nir_intrinsic_interp_deref_at_offset ||
- intr->intrinsic == nir_intrinsic_interp_deref_at_sample)
+ intr->intrinsic == nir_intrinsic_interp_deref_at_sample ||
+ intr->intrinsic == nir_intrinsic_interp_deref_at_vertex)
nir_src_copy(&chan_intr->src[1], &intr->src[1], &chan_intr->instr);
nir_builder_instr_insert(b, &chan_intr->instr);
intr->intrinsic != nir_intrinsic_store_deref &&
intr->intrinsic != nir_intrinsic_interp_deref_at_centroid &&
intr->intrinsic != nir_intrinsic_interp_deref_at_sample &&
- intr->intrinsic != nir_intrinsic_interp_deref_at_offset)
+ intr->intrinsic != nir_intrinsic_interp_deref_at_offset &&
+ intr->intrinsic != nir_intrinsic_interp_deref_at_vertex)
continue;
nir_deref_instr *deref = nir_src_as_deref(intr->src[0]);
case nir_intrinsic_interp_deref_at_centroid:
case nir_intrinsic_interp_deref_at_sample:
case nir_intrinsic_interp_deref_at_offset:
+ case nir_intrinsic_interp_deref_at_vertex:
case nir_intrinsic_load_deref:
if ((mask & nir_var_shader_in && mode == nir_var_shader_in) ||
(mask & nir_var_shader_out && mode == nir_var_shader_out))
new_interp->src[0] = nir_src_for_ssa(&new_interp_deref->dest.ssa);
if (interp->intrinsic == nir_intrinsic_interp_deref_at_sample ||
- interp->intrinsic == nir_intrinsic_interp_deref_at_offset) {
+ interp->intrinsic == nir_intrinsic_interp_deref_at_offset ||
+ interp->intrinsic == nir_intrinsic_interp_deref_at_vertex) {
new_interp->src[1] = interp->src[1];
}
if (interp->intrinsic == nir_intrinsic_interp_deref_at_centroid ||
interp->intrinsic == nir_intrinsic_interp_deref_at_sample ||
- interp->intrinsic == nir_intrinsic_interp_deref_at_offset) {
+ interp->intrinsic == nir_intrinsic_interp_deref_at_offset ||
+ interp->intrinsic == nir_intrinsic_interp_deref_at_vertex) {
fixup_interpolation_instr(state, interp, b);
}
}
case nir_intrinsic_load_deref:
case nir_intrinsic_interp_deref_at_centroid:
case nir_intrinsic_interp_deref_at_sample:
- case nir_intrinsic_interp_deref_at_offset: {
+ case nir_intrinsic_interp_deref_at_offset:
+ case nir_intrinsic_interp_deref_at_vertex: {
nir_deref_instr *old_deref = nir_src_as_deref(intrin->src[0]);
if (!(old_deref->mode & modes))
break;
case nir_intrinsic_interp_deref_at_centroid:
case nir_intrinsic_interp_deref_at_sample:
case nir_intrinsic_interp_deref_at_offset:
+ case nir_intrinsic_interp_deref_at_vertex:
case nir_intrinsic_load_uniform:
case nir_intrinsic_load_ubo:
case nir_intrinsic_load_ssbo: