freedreno: Drop custom driver lowering of GL's color clamping.

The mesa/st frontend can do it for us now that we don't need to worry
about breaking precompiles.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8997>
This commit is contained in:
Eric Anholt
2021-02-10 10:28:23 -08:00
committed by Marge Bot
parent 3b9f6af1a9
commit 5fa27e6670
8 changed files with 0 additions and 36 deletions

View File

@@ -469,16 +469,12 @@ ir3_nir_lower_variant(struct ir3_shader_variant *so, nir_shader *s)
if (s->info.stage == MESA_SHADER_VERTEX) {
if (so->key.ucp_enables)
progress |= OPT(s, nir_lower_clip_vs, so->key.ucp_enables, false, false, NULL);
if (so->key.vclamp_color)
progress |= OPT(s, nir_lower_clamp_color_outputs);
} else if (s->info.stage == MESA_SHADER_FRAGMENT) {
bool layer_zero = so->key.layer_zero && (s->info.inputs_read & VARYING_BIT_LAYER);
bool view_zero = so->key.view_zero && (s->info.inputs_read & VARYING_BIT_VIEWPORT);
if (so->key.ucp_enables && !so->shader->compiler->has_clip_cull)
progress |= OPT(s, nir_lower_clip_fs, so->key.ucp_enables, false);
if (so->key.fclamp_color)
progress |= OPT(s, nir_lower_clamp_color_outputs);
if (layer_zero || view_zero)
progress |= OPT(s, ir3_nir_lower_view_layer_id, layer_zero, view_zero);
}

View File

@@ -446,12 +446,6 @@ ir3_setup_used_key(struct ir3_shader *shader)
key->view_zero = true;
}
if ((info->outputs_written & ~(FRAG_RESULT_DEPTH |
FRAG_RESULT_STENCIL |
FRAG_RESULT_SAMPLE_MASK)) != 0) {
key->fclamp_color = true;
}
/* Only used for deciding on behavior of
* nir_intrinsic_load_barycentric_sample
*/
@@ -460,9 +454,6 @@ ir3_setup_used_key(struct ir3_shader *shader)
key->tessellation = ~0;
key->has_gs = true;
if (info->outputs_written & VARYING_BITS_COLOR)
key->vclamp_color = true;
if (info->stage == MESA_SHADER_VERTEX) {
key->vsaturate_s = ~0;
key->vsaturate_t = ~0;

View File

@@ -287,11 +287,6 @@ struct ir3_shader_key {
/* do we need to check {v,f}saturate_{s,t,r}? */
unsigned has_per_samp : 1;
/*
* Vertex shader variant parameters:
*/
unsigned vclamp_color : 1;
/*
* Fragment shader variant parameters:
*/
@@ -301,7 +296,6 @@ struct ir3_shader_key {
* for front/back color inputs to frag shader:
*/
unsigned rasterflat : 1;
unsigned fclamp_color : 1;
/* Indicates that this is a tessellation pipeline which requires a
* whole different kind of vertex shader. In case of
@@ -385,9 +379,6 @@ ir3_shader_key_changes_fs(struct ir3_shader_key *key, struct ir3_shader_key *las
return true;
}
if (last_key->fclamp_color != key->fclamp_color)
return true;
if (last_key->rasterflat != key->rasterflat)
return true;
@@ -416,9 +407,6 @@ ir3_shader_key_changes_vs(struct ir3_shader_key *key, struct ir3_shader_key *las
return true;
}
if (last_key->vclamp_color != key->vclamp_color)
return true;
if (last_key->ucp_enables != key->ucp_enables)
return true;

View File

@@ -130,8 +130,6 @@ fd3_draw_vbo(struct fd_context *ctx, const struct pipe_draw_info *info,
.indirect = indirect,
.draw = draw,
.key = {
.vclamp_color = ctx->rasterizer->clamp_vertex_color,
.fclamp_color = ctx->rasterizer->clamp_fragment_color,
.has_per_samp = (fd3_ctx->fsaturate || fd3_ctx->vsaturate),
.vsaturate_s = fd3_ctx->vsaturate_s,
.vsaturate_t = fd3_ctx->vsaturate_t,

View File

@@ -114,8 +114,6 @@ fd4_draw_vbo(struct fd_context *ctx, const struct pipe_draw_info *info,
.indirect = indirect,
.draw = draw,
.key = {
.vclamp_color = ctx->rasterizer->clamp_vertex_color,
.fclamp_color = ctx->rasterizer->clamp_fragment_color,
.rasterflat = ctx->rasterizer->flatshade,
.ucp_enables = ctx->rasterizer->clip_plane_enable,
.has_per_samp = (fd4_ctx->fsaturate || fd4_ctx->vsaturate ||

View File

@@ -109,8 +109,6 @@ fd5_draw_vbo(struct fd_context *ctx, const struct pipe_draw_info *info,
.indirect = indirect,
.draw = draw,
.key = {
.vclamp_color = ctx->rasterizer->clamp_vertex_color,
.fclamp_color = ctx->rasterizer->clamp_fragment_color,
.rasterflat = ctx->rasterizer->flatshade,
.ucp_enables = ctx->rasterizer->clip_plane_enable,
.has_per_samp = (fd5_ctx->fsaturate || fd5_ctx->vsaturate ||

View File

@@ -186,8 +186,6 @@ fd6_draw_vbo(struct fd_context *ctx, const struct pipe_draw_info *info,
.gs = ctx->prog.gs,
.fs = ctx->prog.fs,
.key = {
.vclamp_color = ctx->rasterizer->clamp_vertex_color,
.fclamp_color = ctx->rasterizer->clamp_fragment_color,
.rasterflat = ctx->rasterizer->flatshade,
.ucp_enables = ctx->rasterizer->clip_plane_enable,
.has_per_samp = (fd6_ctx->fsaturate || fd6_ctx->vsaturate),

View File

@@ -386,9 +386,6 @@ fd_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
case PIPE_CAP_SHAREABLE_SHADERS:
case PIPE_CAP_GLSL_OPTIMIZE_CONSERVATIVELY:
/* manage the variants for these ourself, to avoid breaking precompile: */
case PIPE_CAP_FRAGMENT_COLOR_CLAMPED:
case PIPE_CAP_VERTEX_COLOR_CLAMPED:
if (is_ir3(screen))
return 1;
return 0;