c->last_thrsw->is_last_thrsw = true;
}
-/* There's a flag in the shader for "centroid W used in addition to center W",
- * so we need to walk the program after VIR optimization to see if both are
- * used.
+/* There's a flag in the shader for "center W is needed for reasons other than
+ * non-centroid varyings", so we just walk the program after VIR optimization
+ * to see if it's used. It should be harmless to set even if we only use
+ * center W for varyings.
*/
static void
vir_check_payload_w(struct v3d_compile *c)
if (c->s->info.stage != MESA_SHADER_FRAGMENT)
return;
- bool any_centroid = false;
- for (int i = 0; i < ARRAY_SIZE(c->centroid_flags); i++) {
- if (c->centroid_flags[i])
- any_centroid = true;
- }
- if (!any_centroid)
- return;
-
vir_for_each_inst_inorder(inst, c) {
for (int i = 0; i < vir_get_nsrc(inst); i++) {
if (inst->src[i].file == QFILE_REG &&
inst->src[i].index == 0) {
- c->uses_centroid_and_center_w = true;
+ c->uses_center_w = true;
return;
}
}
uint32_t centroid_flags[BITSET_WORDS(V3D_MAX_FS_INPUTS)];
- bool uses_centroid_and_center_w;
+ bool uses_center_w;
struct v3d_ubo_range *ubo_ranges;
bool *ubo_range_used;
bool writes_z;
bool discard;
- bool uses_centroid_and_center_w;
+ bool uses_center_w;
};
/* Special nir_load_input intrinsic index for loading the current TLB
prog_data->writes_z = (c->s->info.outputs_written &
(1 << FRAG_RESULT_DEPTH));
prog_data->discard = c->s->info.fs.uses_discard;
- prog_data->uses_centroid_and_center_w = c->uses_centroid_and_center_w;
+ prog_data->uses_center_w = c->uses_center_w;
return v3d_return_qpu_insts(c, final_assembly_size);
}
v3d->prog.fs->prog_data.fs->discard);
shader.fragment_shader_uses_real_pixel_centre_w_in_addition_to_centroid_w2 =
- v3d->prog.fs->prog_data.fs->uses_centroid_and_center_w;
+ v3d->prog.fs->prog_data.fs->uses_center_w;
shader.number_of_varyings_in_fragment_shader =
v3d->prog.fs->prog_data.base->num_inputs;