mesa/st: Set uses_sample_shading when forcing per-sample
authorAlyssa Rosenzweig <alyssa@rosenzweig.io>
Sun, 9 Apr 2023 01:09:06 +0000 (21:09 -0400)
committerMarge Bot <emma+marge@anholt.net>
Tue, 11 Apr 2023 03:32:41 +0000 (03:32 +0000)
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>

src/gallium/drivers/d3d12/ci/d3d12-quick_gl.txt
src/mesa/state_tracker/st_program.c

index 93ccb98..3791fd4 100644 (file)
@@ -37,8 +37,6 @@ spec@arb_draw_indirect@arb_draw_indirect-api-errors,Crash
 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
index 70eb85b..e06e381 100644 (file)
@@ -937,6 +937,14 @@ st_create_fp_variant(struct st_context *st,
       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;
    }