static nir_variable* tex_get_texture_var(nir_tex_instr *instr)
{
- if (instr->texture)
- return instr->texture->var;
-
for (unsigned i = 0; i < instr->num_srcs; i++) {
switch (instr->src[i].src_type) {
case nir_tex_src_texture_deref:
static nir_variable* intrinsic_get_var(nir_intrinsic_instr *instr)
{
- if (instr->variables[0])
- return instr->variables[0]->var;
-
return nir_deref_instr_get_variable(nir_src_as_deref(instr->src[0]));
}
case nir_intrinsic_load_tess_level_outer:
info->reads_tess_factors = true;
break;
- case nir_intrinsic_image_var_load:
- case nir_intrinsic_image_var_size:
- case nir_intrinsic_image_var_samples:
case nir_intrinsic_image_deref_load:
case nir_intrinsic_image_deref_size:
case nir_intrinsic_image_deref_samples: {
break;
}
- case nir_intrinsic_image_var_store:
- case nir_intrinsic_image_var_atomic_add:
- case nir_intrinsic_image_var_atomic_min:
- case nir_intrinsic_image_var_atomic_max:
- case nir_intrinsic_image_var_atomic_and:
- case nir_intrinsic_image_var_atomic_or:
- case nir_intrinsic_image_var_atomic_xor:
- case nir_intrinsic_image_var_atomic_exchange:
- case nir_intrinsic_image_var_atomic_comp_swap:
case nir_intrinsic_image_deref_store:
case nir_intrinsic_image_deref_atomic_add:
case nir_intrinsic_image_deref_atomic_min:
case nir_intrinsic_ssbo_atomic_comp_swap:
info->writes_memory = true;
break;
- case nir_intrinsic_load_var:
case nir_intrinsic_load_deref: {
nir_variable *var = intrinsic_get_var(intr);
nir_variable_mode mode = var->data.mode;
}
break;
}
- case nir_intrinsic_interp_var_at_centroid:
- case nir_intrinsic_interp_var_at_sample:
- case nir_intrinsic_interp_var_at_offset:
case nir_intrinsic_interp_deref_at_centroid:
case nir_intrinsic_interp_deref_at_sample:
case nir_intrinsic_interp_deref_at_offset: {
switch (interp) {
case INTERP_MODE_SMOOTH:
case INTERP_MODE_NONE:
- if (intr->intrinsic == nir_intrinsic_interp_var_at_centroid ||
- intr->intrinsic == nir_intrinsic_interp_deref_at_centroid)
+ if (intr->intrinsic == nir_intrinsic_interp_deref_at_centroid)
info->uses_persp_opcode_interp_centroid = true;
- else if (intr->intrinsic == nir_intrinsic_interp_var_at_sample ||
- intr->intrinsic == nir_intrinsic_interp_deref_at_sample)
+ else if (intr->intrinsic == nir_intrinsic_interp_deref_at_sample)
info->uses_persp_opcode_interp_sample = true;
else
info->uses_persp_opcode_interp_offset = true;
break;
case INTERP_MODE_NOPERSPECTIVE:
- if (intr->intrinsic == nir_intrinsic_interp_var_at_centroid ||
- intr->intrinsic == nir_intrinsic_interp_deref_at_centroid)
+ if (intr->intrinsic == nir_intrinsic_interp_deref_at_centroid)
info->uses_linear_opcode_interp_centroid = true;
- else if (intr->intrinsic == nir_intrinsic_interp_var_at_sample ||
- intr->intrinsic == nir_intrinsic_interp_deref_at_sample)
+ else if (intr->intrinsic == nir_intrinsic_interp_deref_at_sample)
info->uses_linear_opcode_interp_sample = true;
else
info->uses_linear_opcode_interp_offset = true;