In addition to requiring per-sample interpolation, sample shading
changes the behaviour of gl_SampleMaskIn, so we need per-sample shading
even if there are no shader-in variables at all. In that case,
uses_sample_shading won't be set by glsl_to_nir. We need to do so here.
Affected dEQP test on asahi:
dEQP-GLES31.functional.shaders.sample_variables.sample_mask_in.bits_unique_per_two_samples.multisample_texture_4
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22402>
spec@arb_explicit_attrib_location@overlapping-locations-input-attribs api,Crash
spec@arb_explicit_attrib_location@overlapping-locations-input-attribs shader,Crash
spec@arb_framebuffer_object@fbo-blit-scaled-linear,Fail
-spec@arb_framebuffer_no_attachments@arb_framebuffer_no_attachments-atomic,Fail
-spec@arb_framebuffer_no_attachments@arb_framebuffer_no_attachments-atomic@Per-sample,Fail
spec@arb_get_program_binary@restore-sso-program,Fail
spec@arb_point_sprite@arb_point_sprite-mipmap,Fail
spec@arb_program_interface_query@arb_program_interface_query-getprogramresourceindex,Fail
nir_shader *shader = state.ir.nir;
nir_foreach_shader_in_variable(var, shader)
var->data.sample = true;
+
+ /* In addition to requiring per-sample interpolation, sample shading
+ * changes the behaviour of gl_SampleMaskIn, so we need per-sample shading
+ * even if there are no shader-in variables at all. In that case,
+ * uses_sample_shading won't be set by glsl_to_nir. We need to do so here.
+ */
+ shader->info.fs.uses_sample_shading = true;
+
finalize = true;
}