var->data.sample = false;
}
BITSET_CLEAR(s->info.system_values_read, SYSTEM_VALUE_SAMPLE_ID);
+ s->info.fs.uses_sample_qualifier = false;
+ s->info.fs.uses_sample_shading = false;
return progress;
}
}
ctx->mod.info.has_per_sample_input =
- BITSET_TEST(ctx->shader->info.system_values_read, SYSTEM_VALUE_SAMPLE_ID);
+ BITSET_TEST(ctx->shader->info.system_values_read, SYSTEM_VALUE_SAMPLE_ID) ||
+ ctx->shader->info.fs.uses_sample_shading ||
+ ctx->shader->info.fs.uses_sample_qualifier;
if (!ctx->mod.info.has_per_sample_input && ctx->shader->info.stage == MESA_SHADER_FRAGMENT) {
nir_foreach_variable_with_modes(var, ctx->shader, nir_var_shader_in | nir_var_system_value) {
if (var->data.sample) {
driver_location = MAX2(driver_location, var->data.driver_location + 1);
if (ctx->shader->info.stage == MESA_SHADER_FRAGMENT &&
- ctx->shader->info.inputs_read &&
!BITSET_TEST(ctx->shader->info.system_values_read, SYSTEM_VALUE_SAMPLE_ID)) {
- bool need_sample_id = false;
+ bool need_sample_id = ctx->shader->info.fs.uses_sample_shading;
/* "var->data.sample = true" sometimes just mean, "I want per-sample
* shading", which explains why we can end up with vars having flat
// Force sample-rate shading if we're asked to.
if (conf->force_sample_rate_shading) {
assert(nir->info.stage == MESA_SHADER_FRAGMENT);
- nir_foreach_shader_in_variable(var, nir)
- var->data.sample = true;
+ nir->info.fs.uses_sample_shading = true;
}
if (conf->zero_based_vertex_instance_id) {