freedreno: Drop custom driver lowering of two-sided color.

The GL frontend can do it for us now, so just use their code instead of
our own shader variants.  In the past we had to do hide the GL shader
variants in the driver to get precompiles from st, but no longer as of
!8601.

I tested with drawoverhead -test 6 (shader program change, n=30) and -test
1 (no statechanges, n=43) and saw no change in driver overhead.

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

View file

@ -482,10 +482,6 @@ ir3_nir_lower_variant(struct ir3_shader_variant *so, nir_shader *s)
if (layer_zero || view_zero)
progress |= OPT(s, ir3_nir_lower_view_layer_id, layer_zero, view_zero);
}
if (so->key.color_two_side) {
OPT_V(s, nir_lower_two_sided_color, true);
progress = true;
}
struct nir_lower_tex_options tex_options = { };

View file

@ -436,7 +436,6 @@ ir3_setup_used_key(struct ir3_shader *shader)
if (info->inputs_read & VARYING_BITS_COLOR) {
key->rasterflat = true;
key->color_two_side = true;
}
if (info->inputs_read & VARYING_BIT_LAYER) {

View file

@ -297,7 +297,6 @@ struct ir3_shader_key {
*/
unsigned sample_shading : 1;
unsigned msaa : 1;
unsigned color_two_side : 1;
/* used when shader needs to handle flat varyings (a4xx)
* for front/back color inputs to frag shader:
*/
@ -389,9 +388,6 @@ ir3_shader_key_changes_fs(struct ir3_shader_key *key, struct ir3_shader_key *las
if (last_key->fclamp_color != key->fclamp_color)
return true;
if (last_key->color_two_side != key->color_two_side)
return true;
if (last_key->rasterflat != key->rasterflat)
return true;

View file

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

View file

@ -114,7 +114,6 @@ fd4_draw_vbo(struct fd_context *ctx, const struct pipe_draw_info *info,
.indirect = indirect,
.draw = draw,
.key = {
.color_two_side = ctx->rasterizer->light_twoside,
.vclamp_color = ctx->rasterizer->clamp_vertex_color,
.fclamp_color = ctx->rasterizer->clamp_fragment_color,
.rasterflat = ctx->rasterizer->flatshade,

View file

@ -109,7 +109,6 @@ fd5_draw_vbo(struct fd_context *ctx, const struct pipe_draw_info *info,
.indirect = indirect,
.draw = draw,
.key = {
.color_two_side = ctx->rasterizer->light_twoside,
.vclamp_color = ctx->rasterizer->clamp_vertex_color,
.fclamp_color = ctx->rasterizer->clamp_fragment_color,
.rasterflat = ctx->rasterizer->flatshade,

View file

@ -186,7 +186,6 @@ fd6_draw_vbo(struct fd_context *ctx, const struct pipe_draw_info *info,
.gs = ctx->prog.gs,
.fs = ctx->prog.fs,
.key = {
.color_two_side = ctx->rasterizer->light_twoside,
.vclamp_color = ctx->rasterizer->clamp_vertex_color,
.fclamp_color = ctx->rasterizer->clamp_fragment_color,
.rasterflat = ctx->rasterizer->flatshade,

View file

@ -475,6 +475,8 @@ fd_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
return is_a6xx(screen);
case PIPE_CAP_SHADER_STENCIL_EXPORT:
return is_a6xx(screen);
case PIPE_CAP_TWO_SIDED_COLOR:
return 0;
default:
return u_pipe_screen_get_param_defaults(pscreen, param);
}