From d998217e179641fd6a8e6f18416c549d7a694712 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Sat, 8 Apr 2023 21:09:06 -0400 Subject: [PATCH] mesa/st: Set uses_sample_shading when forcing per-sample 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 Reviewed-by: Jesse Natalie Part-of: --- src/gallium/drivers/d3d12/ci/d3d12-quick_gl.txt | 2 -- src/mesa/state_tracker/st_program.c | 8 ++++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/d3d12/ci/d3d12-quick_gl.txt b/src/gallium/drivers/d3d12/ci/d3d12-quick_gl.txt index 93ccb98..3791fd4 100644 --- a/src/gallium/drivers/d3d12/ci/d3d12-quick_gl.txt +++ b/src/gallium/drivers/d3d12/ci/d3d12-quick_gl.txt @@ -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 diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c index 70eb85b..e06e381 100644 --- a/src/mesa/state_tracker/st_program.c +++ b/src/mesa/state_tracker/st_program.c @@ -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; } -- 2.7.4