aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/iris/iris_resolve.c
diff options
context:
space:
mode:
authorSagar Ghuge <[email protected]>2019-07-16 11:08:28 -0700
committerKenneth Graunke <[email protected]>2019-08-20 00:50:44 -0700
commit638a157e022e838ee8cae8ba230308fec7f1deca (patch)
tree643b225d5e8b8d9c38a4ffc2feaef200461895e6 /src/gallium/drivers/iris/iris_resolve.c
parent61c0637afb4ff760dd8dbe138266820adc921ce5 (diff)
iris: Add infrastructure to support non coherent framebuffer fetch
Create separate SURFACE_STATE for render target read in order to support non coherent framebuffer fetch on broadwell. Also we need to resolve framebuffer in order to support CCS_D. v2: Add outputs_read check (Kenneth Graunke) v3: 1) Import Curro's comment from get_isl_surf 2) Rename get_isl_surf method 3) Clean up allocation in case of failure Signed-off-by: Sagar Ghuge <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/gallium/drivers/iris/iris_resolve.c')
-rw-r--r--src/gallium/drivers/iris/iris_resolve.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/gallium/drivers/iris/iris_resolve.c b/src/gallium/drivers/iris/iris_resolve.c
index fb07d169f8d..f2255e8f5fb 100644
--- a/src/gallium/drivers/iris/iris_resolve.c
+++ b/src/gallium/drivers/iris/iris_resolve.c
@@ -34,6 +34,7 @@
#include "util/hash_table.h"
#include "util/set.h"
#include "iris_context.h"
+#include "compiler/nir/nir.h"
/**
* Disable auxiliary buffers if a renderbuffer is also bound as a texture
@@ -177,6 +178,11 @@ iris_predraw_resolve_framebuffer(struct iris_context *ice,
bool *draw_aux_buffer_disabled)
{
struct pipe_framebuffer_state *cso_fb = &ice->state.framebuffer;
+ struct iris_screen *screen = (void *) ice->ctx.screen;
+ struct gen_device_info *devinfo = &screen->devinfo;
+ struct iris_uncompiled_shader *ish =
+ ice->shaders.uncompiled[MESA_SHADER_FRAGMENT];
+ const nir_shader *nir = ish->nir;
if (ice->state.dirty & IRIS_DIRTY_DEPTH_BUFFER) {
struct pipe_surface *zs_surf = cso_fb->zsbuf;
@@ -201,6 +207,21 @@ iris_predraw_resolve_framebuffer(struct iris_context *ice,
}
}
+ if (devinfo->gen == 8 && nir->info.outputs_read != 0) {
+ for (unsigned i = 0; i < cso_fb->nr_cbufs; i++) {
+ if (cso_fb->cbufs[i]) {
+ struct iris_surface *surf = (void *) cso_fb->cbufs[i];
+ struct iris_resource *res = (void *) cso_fb->cbufs[i]->texture;
+
+ iris_resource_prepare_texture(ice, batch, res, surf->view.format,
+ surf->view.base_level, 1,
+ surf->view.base_array_layer,
+ surf->view.array_len,
+ 0);
+ }
+ }
+ }
+
if (ice->state.dirty & (IRIS_DIRTY_BINDINGS_FS | IRIS_DIRTY_BLEND_STATE)) {
for (unsigned i = 0; i < cso_fb->nr_cbufs; i++) {
struct iris_surface *surf = (void *) cso_fb->cbufs[i];