From fe0e9db797eee739f9705bd833acc35bf2cf96a6 Mon Sep 17 00:00:00 2001 From: Sagar Ghuge Date: Tue, 16 Jul 2019 11:29:47 -0700 Subject: [PATCH] iris: Enable non coherent framebuffer fetch on broadwell v2: Use GEN_GEN in iris_state (Kenneth Graunke) Signed-off-by: Sagar Ghuge Reviewed-by: Caio Marcelo de Oliveira Filho Reviewed-by: Kenneth Graunke --- src/gallium/drivers/iris/iris_program.c | 2 +- src/gallium/drivers/iris/iris_screen.c | 3 +-- src/gallium/drivers/iris/iris_state.c | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/gallium/drivers/iris/iris_program.c b/src/gallium/drivers/iris/iris_program.c index 90d7492f0e8..7a64951d0bd 100644 --- a/src/gallium/drivers/iris/iris_program.c +++ b/src/gallium/drivers/iris/iris_program.c @@ -2131,7 +2131,7 @@ iris_create_fs_state(struct pipe_context *ctx, struct brw_wm_prog_key key = { KEY_INIT(devinfo->gen), .nr_color_regions = util_bitcount(color_outputs), - .coherent_fb_fetch = true, + .coherent_fb_fetch = devinfo->gen >= 9, .input_slots_valid = can_rearrange_varyings ? 0 : info->inputs_read | VARYING_BIT_POS, }; diff --git a/src/gallium/drivers/iris/iris_screen.c b/src/gallium/drivers/iris/iris_screen.c index e92685d4ae6..fa528a0d67a 100644 --- a/src/gallium/drivers/iris/iris_screen.c +++ b/src/gallium/drivers/iris/iris_screen.c @@ -202,8 +202,7 @@ iris_get_param(struct pipe_screen *pscreen, enum pipe_cap param) case PIPE_CAP_SHADER_SAMPLES_IDENTICAL: return true; case PIPE_CAP_FBFETCH: - /* TODO: Support non-coherent FB fetch on Broadwell */ - return devinfo->gen >= 9 ? BRW_MAX_DRAW_BUFFERS : 0; + return BRW_MAX_DRAW_BUFFERS; case PIPE_CAP_FBFETCH_COHERENT: case PIPE_CAP_CONSERVATIVE_RASTER_INNER_COVERAGE: case PIPE_CAP_POST_DEPTH_COVERAGE: diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c index 98fe87c7f06..529165bafa9 100644 --- a/src/gallium/drivers/iris/iris_state.c +++ b/src/gallium/drivers/iris/iris_state.c @@ -3624,7 +3624,7 @@ iris_populate_fs_key(const struct iris_context *ice, key->persample_interp = rast->force_persample_interp; key->multisample_fbo = rast->multisample && fb->samples > 1; - key->coherent_fb_fetch = true; + key->coherent_fb_fetch = GEN_GEN >= 9; key->force_dual_color_blend = screen->driconf.dual_color_blend_by_location && -- 2.30.2