aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2020-06-15 14:37:24 -0700
committerRob Clark <[email protected]>2020-06-26 08:43:22 -0700
commitf1ab57359c7a98ecd45ba3da905dd44c4d7cae5b (patch)
treee5f3c0ae5f3ce87d7300c7484d28df4b3530820e /src/gallium/drivers/freedreno
parentd3ae55937830853349bcc80298714167839c42f2 (diff)
freedreno/ir3: move finalize_nir to pscreen hook
Signed-off-by: Rob Clark <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5372>
Diffstat (limited to 'src/gallium/drivers/freedreno')
-rw-r--r--src/gallium/drivers/freedreno/a3xx/fd3_screen.c1
-rw-r--r--src/gallium/drivers/freedreno/a4xx/fd4_screen.c1
-rw-r--r--src/gallium/drivers/freedreno/a5xx/fd5_screen.c1
-rw-r--r--src/gallium/drivers/freedreno/a6xx/fd6_screen.c1
-rw-r--r--src/gallium/drivers/freedreno/ir3/ir3_gallium.c14
-rw-r--r--src/gallium/drivers/freedreno/ir3/ir3_gallium.h1
6 files changed, 19 insertions, 0 deletions
diff --git a/src/gallium/drivers/freedreno/a3xx/fd3_screen.c b/src/gallium/drivers/freedreno/a3xx/fd3_screen.c
index 772426c82f3..64b806dc8fd 100644
--- a/src/gallium/drivers/freedreno/a3xx/fd3_screen.c
+++ b/src/gallium/drivers/freedreno/a3xx/fd3_screen.c
@@ -109,6 +109,7 @@ fd3_screen_init(struct pipe_screen *pscreen)
pscreen->context_create = fd3_context_create;
pscreen->is_format_supported = fd3_screen_is_format_supported;
fd3_emit_init_screen(pscreen);
+ ir3_screen_init(pscreen);
screen->setup_slices = fd3_setup_slices;
if (fd_mesa_debug & FD_DBG_TTILE)
diff --git a/src/gallium/drivers/freedreno/a4xx/fd4_screen.c b/src/gallium/drivers/freedreno/a4xx/fd4_screen.c
index 7f7c36da9b7..8f60b51bf8f 100644
--- a/src/gallium/drivers/freedreno/a4xx/fd4_screen.c
+++ b/src/gallium/drivers/freedreno/a4xx/fd4_screen.c
@@ -114,4 +114,5 @@ fd4_screen_init(struct pipe_screen *pscreen)
pscreen->context_create = fd4_context_create;
pscreen->is_format_supported = fd4_screen_is_format_supported;
fd4_emit_init_screen(pscreen);
+ ir3_screen_init(pscreen);
}
diff --git a/src/gallium/drivers/freedreno/a5xx/fd5_screen.c b/src/gallium/drivers/freedreno/a5xx/fd5_screen.c
index 9a4df4d26fb..799765a956a 100644
--- a/src/gallium/drivers/freedreno/a5xx/fd5_screen.c
+++ b/src/gallium/drivers/freedreno/a5xx/fd5_screen.c
@@ -135,4 +135,5 @@ fd5_screen_init(struct pipe_screen *pscreen)
screen->tile_mode = fd5_tile_mode;
fd5_emit_init_screen(pscreen);
+ ir3_screen_init(pscreen);
}
diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_screen.c b/src/gallium/drivers/freedreno/a6xx/fd6_screen.c
index bb467112ed0..9db4ce15e96 100644
--- a/src/gallium/drivers/freedreno/a6xx/fd6_screen.c
+++ b/src/gallium/drivers/freedreno/a6xx/fd6_screen.c
@@ -140,4 +140,5 @@ fd6_screen_init(struct pipe_screen *pscreen)
fd6_resource_screen_init(pscreen);
fd6_emit_init_screen(pscreen);
+ ir3_screen_init(pscreen);
}
diff --git a/src/gallium/drivers/freedreno/ir3/ir3_gallium.c b/src/gallium/drivers/freedreno/ir3/ir3_gallium.c
index 2a6bc936a31..a660a916d99 100644
--- a/src/gallium/drivers/freedreno/ir3/ir3_gallium.c
+++ b/src/gallium/drivers/freedreno/ir3/ir3_gallium.c
@@ -294,6 +294,14 @@ ir3_shader_state_delete(struct pipe_context *pctx, void *hwcso)
ir3_shader_destroy(so);
}
+static void
+ir3_screen_finalize_nir(struct pipe_screen *pscreen, void *nir, bool optimize)
+{
+ struct fd_screen *screen = fd_screen(pscreen);
+
+ ir3_finalize_nir(screen->compiler, nir);
+}
+
void
ir3_prog_init(struct pipe_context *pctx)
{
@@ -312,3 +320,9 @@ ir3_prog_init(struct pipe_context *pctx)
pctx->create_fs_state = ir3_shader_state_create;
pctx->delete_fs_state = ir3_shader_state_delete;
}
+
+void
+ir3_screen_init(struct pipe_screen *pscreen)
+{
+ pscreen->finalize_nir = ir3_screen_finalize_nir;
+}
diff --git a/src/gallium/drivers/freedreno/ir3/ir3_gallium.h b/src/gallium/drivers/freedreno/ir3/ir3_gallium.h
index 655fb913e78..10445069916 100644
--- a/src/gallium/drivers/freedreno/ir3/ir3_gallium.h
+++ b/src/gallium/drivers/freedreno/ir3/ir3_gallium.h
@@ -48,6 +48,7 @@ void * ir3_shader_state_create(struct pipe_context *pctx, const struct pipe_shad
void ir3_shader_state_delete(struct pipe_context *pctx, void *hwcso);
void ir3_prog_init(struct pipe_context *pctx);
+void ir3_screen_init(struct pipe_screen *pscreen);
/**
* A helper to determine if a fs input 'i' is point/sprite coord, given