zink: add Sample decorations to fragment shader inputs with sample shading

PIPE_CAP_FORCE_PERSAMPLE_INTERP is broken for the no-attachment case, so
this is the only option

fixes (lavapipe):
KHR-GL46.sample_shading.render*
dEQP-GLES31.functional.sample_shading.min_sample_shading*

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14852>
This commit is contained in:
Mike Blumenkrantz
2022-02-02 20:19:55 -05:00
parent 0cb5333a14
commit 63fa2ab978
3 changed files with 10 additions and 0 deletions
+5
View File
@@ -1087,6 +1087,11 @@ zink_shader_compile(struct zink_screen *screen, struct zink_shader *zs, nir_shad
NIR_PASS_V(nir, nir_lower_texcoord_replace, zink_fs_key(key)->coord_replace_bits,
false, zink_fs_key(key)->coord_replace_yinvert);
}
if (zink_fs_key(key)->force_persample_interp) {
nir_foreach_shader_in_variable(var, nir)
var->data.sample = true;
nir->info.fs.uses_sample_qualifier = true;
}
if (nir->info.fs.uses_fbfetch_output) {
nir_variable *fbfetch = NULL;
NIR_PASS_V(nir, lower_fbfetch, &fbfetch);
@@ -60,6 +60,7 @@ struct zink_fs_key {
bool coord_replace_yinvert;
bool samples;
bool force_dual_color_blend;
bool force_persample_interp;
};
struct zink_shader_key_base {
+4
View File
@@ -680,6 +680,7 @@ zink_bind_rasterizer_state(struct pipe_context *pctx, void *cso)
bool point_quad_rasterization = ctx->rast_state ? ctx->rast_state->base.point_quad_rasterization : false;
bool scissor = ctx->rast_state ? ctx->rast_state->base.scissor : false;
bool pv_last = ctx->rast_state ? ctx->rast_state->hw_state.pv_last : false;
bool force_persample_interp = ctx->rast_state ? ctx->rast_state->hw_state.force_persample_interp : false;
ctx->rast_state = cso;
if (ctx->rast_state) {
@@ -708,6 +709,9 @@ zink_bind_rasterizer_state(struct pipe_context *pctx, void *cso)
zink_set_fs_point_coord_key(ctx);
if (ctx->rast_state->base.scissor != scissor)
ctx->scissor_changed = true;
if (ctx->rast_state->base.force_persample_interp != force_persample_interp)
zink_set_fs_key(ctx)->force_persample_interp = ctx->rast_state->base.force_persample_interp;
}
}