From: Iván Briano Date: Tue, 5 Sep 2023 04:40:46 +0000 (-0700) Subject: anv: track what kind of pipeline a fragment shader may be used with X-Git-Tag: upstream/23.3.3~2133 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d36da7c5f82d0ff1608bd90ce5a9aafec7f556d4;p=platform%2Fupstream%2Fmesa.git anv: track what kind of pipeline a fragment shader may be used with Reviewed-by: Caio Oliveira Part-of: --- diff --git a/src/intel/compiler/brw_compiler.h b/src/intel/compiler/brw_compiler.h index c39c8f5..85f8644 100644 --- a/src/intel/compiler/brw_compiler.h +++ b/src/intel/compiler/brw_compiler.h @@ -557,11 +557,14 @@ struct brw_wm_prog_key { enum brw_sometimes line_aa:2; + /* Whether the preceding shader stage is mesh */ + enum brw_sometimes mesh_input:2; + bool coherent_fb_fetch:1; bool ignore_sample_mask_out:1; bool coarse_pixel:1; - uint64_t padding:55; + uint64_t padding:53; }; struct brw_cs_prog_key { diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_pipeline.c index 5e9ea5e..831a1ab 100644 --- a/src/intel/vulkan/anv_pipeline.c +++ b/src/intel/vulkan/anv_pipeline.c @@ -585,7 +585,8 @@ populate_wm_prog_key(struct anv_pipeline_stage *stage, const BITSET_WORD *dynamic, const struct vk_multisample_state *ms, const struct vk_fragment_shading_rate_state *fsr, - const struct vk_render_pass_state *rp) + const struct vk_render_pass_state *rp, + const enum brw_sometimes is_mesh) { const struct anv_device *device = pipeline->base.device; @@ -651,6 +652,8 @@ populate_wm_prog_key(struct anv_pipeline_stage *stage, key->persample_interp = BRW_SOMETIMES; } + key->mesh_input = is_mesh; + /* Vulkan doesn't support fixed-function alpha test */ key->alpha_test_replicate_alpha = false; @@ -1728,11 +1731,22 @@ anv_graphics_pipeline_init_keys(struct anv_graphics_base_pipeline *pipeline, state->rs == NULL || !state->rs->rasterizer_discard_enable || BITSET_TEST(state->dynamic, MESA_VK_DYNAMIC_RS_RASTERIZER_DISCARD_ENABLE); + enum brw_sometimes is_mesh = BRW_NEVER; + if (device->vk.enabled_extensions.EXT_mesh_shader) { + if (anv_pipeline_base_has_stage(pipeline, MESA_SHADER_VERTEX)) + is_mesh = BRW_NEVER; + else if (anv_pipeline_base_has_stage(pipeline, MESA_SHADER_MESH)) + is_mesh = BRW_ALWAYS; + else { + assert(pipeline->base.type == ANV_PIPELINE_GRAPHICS_LIB); + is_mesh = BRW_SOMETIMES; + } + } populate_wm_prog_key(&stages[s], pipeline, state->dynamic, raster_enabled ? state->ms : NULL, - state->fsr, state->rp); + state->fsr, state->rp, is_mesh); break; }