mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 15:20:10 +01:00
intel: drop legacy flatshade handling
Let mesa/st do the keying instead. Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37447>
This commit is contained in:
parent
36bd06ebab
commit
804ced9047
12 changed files with 13 additions and 42 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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 =
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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 --
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue