(struct gl_fragment_program *)sh->Program;
shader->info.fs.uses_discard = fp->UsesKill;
+ shader->info.fs.uses_sample_qualifier = fp->IsSample != 0;
shader->info.fs.early_fragment_tests = sh->EarlyFragmentTests;
shader->info.fs.depth_layout = fp->FragDepthLayout;
break;
struct {
bool uses_discard;
+ /**
+ * Whether any inputs are declared with the "sample" qualifier.
+ */
+ bool uses_sample_qualifier;
+
/**
* Whether early fragment tests are enabled as defined by
* ARB_shader_image_load_store.
shader->stage == MESA_SHADER_FRAGMENT ||
shader->stage == MESA_SHADER_COMPUTE);
+ bool uses_sample_qualifier = false;
shader->info.inputs_read = 0;
- foreach_list_typed(nir_variable, var, node, &shader->inputs)
+ foreach_list_typed(nir_variable, var, node, &shader->inputs) {
shader->info.inputs_read |= get_io_mask(var, shader->stage);
+ uses_sample_qualifier |= var->data.sample;
+ }
+
+ if (shader->stage == MESA_SHADER_FRAGMENT)
+ shader->info.fs.uses_sample_qualifier = uses_sample_qualifier;
/* TODO: Some day we may need to add stream support to NIR */
shader->info.outputs_written = 0;