diff --git a/src/gallium/drivers/crocus/crocus_screen.c b/src/gallium/drivers/crocus/crocus_screen.c index a4d26910448..290506855df 100644 --- a/src/gallium/drivers/crocus/crocus_screen.c +++ b/src/gallium/drivers/crocus/crocus_screen.c @@ -410,6 +410,9 @@ crocus_init_screen_caps(struct crocus_screen *screen) PIPE_CONTEXT_PRIORITY_MEDIUM | PIPE_CONTEXT_PRIORITY_HIGH; + /* Let mesa/st lower for us */ + caps->flatshade = false; + caps->frontend_noop = true; // XXX: don't hardcode 00:00:02.0 PCI here caps->pci_group = 0; diff --git a/src/gallium/drivers/crocus/crocus_state.c b/src/gallium/drivers/crocus/crocus_state.c index 948aed0887d..888f22b734a 100644 --- a/src/gallium/drivers/crocus/crocus_state.c +++ b/src/gallium/drivers/crocus/crocus_state.c @@ -4855,9 +4855,6 @@ crocus_populate_fs_key(const struct crocus_context *ice, key->alpha_test_replicate_alpha = fb->nr_cbufs > 1 && zsa->cso.alpha_enabled; - key->flat_shade = rast->cso.flatshade && - (info->inputs_read & (VARYING_BIT_COL0 | VARYING_BIT_COL1)); - const bool multisample_fbo = rast->cso.multisample && fb->samples > 1; key->multisample_fbo = multisample_fbo ? ELK_ALWAYS : ELK_NEVER; key->persample_interp = diff --git a/src/gallium/drivers/iris/iris_context.h b/src/gallium/drivers/iris/iris_context.h index 96fc1669d89..fd887ef9a32 100644 --- a/src/gallium/drivers/iris/iris_context.h +++ b/src/gallium/drivers/iris/iris_context.h @@ -278,7 +278,6 @@ struct iris_fs_prog_key { uint8_t color_outputs_valid; unsigned nr_color_regions:5; - bool flat_shade:1; bool alpha_test_replicate_alpha:1; bool alpha_to_coverage:1; bool persample_interp:1; @@ -286,7 +285,7 @@ struct iris_fs_prog_key { bool force_dual_color_blend:1; bool coherent_fb_fetch:1; enum intel_vue_layout vue_layout:2; - uint64_t padding:42; + uint64_t padding:43; }; struct iris_cs_prog_key { diff --git a/src/gallium/drivers/iris/iris_program.c b/src/gallium/drivers/iris/iris_program.c index 2451aac50f0..155d862dda4 100644 --- a/src/gallium/drivers/iris/iris_program.c +++ b/src/gallium/drivers/iris/iris_program.c @@ -576,7 +576,6 @@ iris_to_brw_fs_key(const struct iris_screen *screen, return (struct brw_wm_prog_key) { BRW_KEY_INIT(key->base, key->vue_layout), .nr_color_regions = key->nr_color_regions, - .flat_shade = key->flat_shade, .alpha_test_replicate_alpha = key->alpha_test_replicate_alpha, .alpha_to_coverage = key->alpha_to_coverage ? INTEL_ALWAYS : INTEL_NEVER, .persample_interp = key->persample_interp ? INTEL_ALWAYS : INTEL_NEVER, @@ -662,7 +661,6 @@ iris_to_elk_fs_key(const struct iris_screen *screen, ELK_KEY_INIT(screen->devinfo->ver, key->base.program_string_id, key->base.limit_trig_input_range), .nr_color_regions = key->nr_color_regions, - .flat_shade = key->flat_shade, .alpha_test_replicate_alpha = key->alpha_test_replicate_alpha, .alpha_to_coverage = key->alpha_to_coverage ? ELK_ALWAYS : ELK_NEVER, .persample_interp = key->persample_interp ? ELK_ALWAYS : ELK_NEVER, diff --git a/src/gallium/drivers/iris/iris_screen.c b/src/gallium/drivers/iris/iris_screen.c index 8e172801ed5..292a293be9f 100644 --- a/src/gallium/drivers/iris/iris_screen.c +++ b/src/gallium/drivers/iris/iris_screen.c @@ -447,6 +447,9 @@ iris_init_screen_caps(struct iris_screen *screen) PIPE_CONTEXT_PRIORITY_MEDIUM | PIPE_CONTEXT_PRIORITY_HIGH; + /* Let mesa/st lower for us */ + caps->flatshade = false; + caps->frontend_noop = true; // XXX: don't hardcode 00:00:02.0 PCI here diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c index 6d15195cf24..c9bd99c830e 100644 --- a/src/gallium/drivers/iris/iris_state.c +++ b/src/gallium/drivers/iris/iris_state.c @@ -5046,9 +5046,6 @@ iris_populate_fs_key(const struct iris_context *ice, key->alpha_test_replicate_alpha = fb->nr_cbufs > 1 && zsa->alpha_enabled; - key->flat_shade = rast->flatshade && - (info->inputs_read & (VARYING_BIT_COL0 | VARYING_BIT_COL1)); - key->persample_interp = rast->force_persample_interp; key->multisample_fbo = rast->multisample && fb->samples > 1; diff --git a/src/intel/compiler/brw_compiler.h b/src/intel/compiler/brw_compiler.h index 75a9abee944..ad20e4b87fa 100644 --- a/src/intel/compiler/brw_compiler.h +++ b/src/intel/compiler/brw_compiler.h @@ -395,7 +395,6 @@ struct brw_wm_prog_key { uint8_t color_outputs_valid; /* Some collection of BRW_WM_IZ_* */ - bool flat_shade:1; unsigned nr_color_regions:5; bool alpha_test_replicate_alpha:1; enum intel_sometimes alpha_to_coverage:2; @@ -426,7 +425,7 @@ struct brw_wm_prog_key { bool coarse_pixel:1; bool null_push_constant_tbimr_workaround:1; bool api_sample_shading:1; - unsigned pad:1; + unsigned pad:2; }; static inline bool diff --git a/src/intel/compiler/brw_debug_recompile.c b/src/intel/compiler/brw_debug_recompile.c index 56c3609f03c..5f644e1ae59 100644 --- a/src/intel/compiler/brw_debug_recompile.c +++ b/src/intel/compiler/brw_debug_recompile.c @@ -132,7 +132,6 @@ debug_fs_recompile(const struct brw_compiler *c, void *log, { bool found = false; - found |= check("flat shading", flat_shade); found |= check("number of color buffers", nr_color_regions); found |= check("MRT alpha test", alpha_test_replicate_alpha); found |= check("alpha to coverage", alpha_to_coverage); diff --git a/src/intel/compiler/brw_nir.c b/src/intel/compiler/brw_nir.c index b5cbc40ec6b..962debf6989 100644 --- a/src/intel/compiler/brw_nir.c +++ b/src/intel/compiler/brw_nir.c @@ -958,19 +958,8 @@ brw_nir_lower_fs_inputs(nir_shader *nir, nir_foreach_shader_in_variable(var, nir) { var->data.driver_location = var->data.location; - /* Apply default interpolation mode. - * - * Everything defaults to smooth except for the legacy GL color - * built-in variables, which might be flat depending on API state. - */ - if (var->data.interpolation == INTERP_MODE_NONE) { - const bool flat = key->flat_shade && - (var->data.location == VARYING_SLOT_COL0 || - var->data.location == VARYING_SLOT_COL1); - - var->data.interpolation = flat ? INTERP_MODE_FLAT - : INTERP_MODE_SMOOTH; - } + if (var->data.interpolation == INTERP_MODE_NONE) + var->data.interpolation = INTERP_MODE_SMOOTH; } NIR_PASS(_, nir, nir_lower_io, diff --git a/src/intel/compiler/elk/elk_compiler.h b/src/intel/compiler/elk/elk_compiler.h index 5001eaad4d7..97b9f632431 100644 --- a/src/intel/compiler/elk/elk_compiler.h +++ b/src/intel/compiler/elk/elk_compiler.h @@ -490,7 +490,6 @@ struct elk_wm_prog_key { /* Some collection of ELK_WM_IZ_* */ uint8_t iz_lookup; bool stats_wm:1; - bool flat_shade:1; unsigned nr_color_regions:5; bool emit_alpha_test:1; enum compare_func alpha_test_func:3; /* < For Gfx4/5 MRT alpha test */ @@ -517,7 +516,7 @@ struct elk_wm_prog_key { bool coherent_fb_fetch:1; bool ignore_sample_mask_out:1; - uint64_t padding:57; + uint64_t padding:58; }; struct elk_cs_prog_key { diff --git a/src/intel/compiler/elk/elk_debug_recompile.c b/src/intel/compiler/elk/elk_debug_recompile.c index 925f15beea0..31ffdfe843d 100644 --- a/src/intel/compiler/elk/elk_debug_recompile.c +++ b/src/intel/compiler/elk/elk_debug_recompile.c @@ -160,7 +160,6 @@ debug_fs_recompile(const struct elk_compiler *c, void *log, found |= check("alphatest, computed depth, depth test, or depth write", iz_lookup); found |= check("depth statistics", stats_wm); - found |= check("flat shading", flat_shade); found |= check("number of color buffers", nr_color_regions); found |= check("MRT alpha test", alpha_test_replicate_alpha); found |= check("alpha to coverage", alpha_to_coverage); diff --git a/src/intel/compiler/elk/elk_nir.c b/src/intel/compiler/elk/elk_nir.c index a94fe9d90d9..7c476eeb226 100644 --- a/src/intel/compiler/elk/elk_nir.c +++ b/src/intel/compiler/elk/elk_nir.c @@ -567,19 +567,8 @@ elk_nir_lower_fs_inputs(nir_shader *nir, nir_foreach_shader_in_variable(var, nir) { var->data.driver_location = var->data.location; - /* Apply default interpolation mode. - * - * Everything defaults to smooth except for the legacy GL color - * built-in variables, which might be flat depending on API state. - */ - if (var->data.interpolation == INTERP_MODE_NONE) { - const bool flat = key->flat_shade && - (var->data.location == VARYING_SLOT_COL0 || - var->data.location == VARYING_SLOT_COL1); - - var->data.interpolation = flat ? INTERP_MODE_FLAT - : INTERP_MODE_SMOOTH; - } + if (var->data.interpolation == INTERP_MODE_NONE) + var->data.interpolation = INTERP_MODE_SMOOTH; /* On Ironlake and below, there is only one interpolation mode. * Centroid interpolation doesn't mean anything on this hardware --