summaryrefslogtreecommitdiffstats
path: root/src/intel/blorp/blorp_priv.h
diff options
context:
space:
mode:
authorJason Ekstrand <jason.ekstrand@intel.com>2016-10-21 12:09:38 -0700
committerEmil Velikov <emil.l.velikov@gmail.com>2016-11-01 12:45:43 +0000
commit89cefe6325b2534c4e35ac0a4b85155a3be57936 (patch)
treec821f52f4dfe06eddd4a5561559ac9f15b6f00da /src/intel/blorp/blorp_priv.h
parent75258017dda55a32dcf3114113f8fccde47a490d (diff)
downloadexternal_mesa3d-89cefe6325b2534c4e35ac0a4b85155a3be57936.zip
external_mesa3d-89cefe6325b2534c4e35ac0a4b85155a3be57936.tar.gz
external_mesa3d-89cefe6325b2534c4e35ac0a4b85155a3be57936.tar.bz2
intel/blorp: Rework our usage of ralloc when compiling shaders
Previously, we were creating the shader with a NULL ralloc context and then trusting in blorp_compile_fs to clean it up. The only problem was that blorp_compile_fs didn't clean up its context properly so we were leaking. When I went to fix that, I realized that it couldn't because it has to return the shader binary which is allocated off of that context and used by the caller. The solution is to make blorp_compile_fs take a ralloc context, allocate the nir_shaders directly off that context, and clean it all up in whatever function creates the shader and calls blorp_compile_fs. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com> Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com> Cc: "12.0, 13.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 43dadb6edd5e3e3e10b1198184a9f75556edad49) [Emil Velikov: resolve trivial conflicts] Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Conflicts: src/intel/blorp/blorp_clear.c
Diffstat (limited to 'src/intel/blorp/blorp_priv.h')
-rw-r--r--src/intel/blorp/blorp_priv.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/intel/blorp/blorp_priv.h b/src/intel/blorp/blorp_priv.h
index bcfd01d..9d14336 100644
--- a/src/intel/blorp/blorp_priv.h
+++ b/src/intel/blorp/blorp_priv.h
@@ -310,7 +310,8 @@ struct brw_blorp_blit_prog_key
void brw_blorp_init_wm_prog_key(struct brw_wm_prog_key *wm_key);
const unsigned *
-blorp_compile_fs(struct blorp_context *blorp, struct nir_shader *nir,
+blorp_compile_fs(struct blorp_context *blorp, void *mem_ctx,
+ struct nir_shader *nir,
const struct brw_wm_prog_key *wm_key,
bool use_repclear,
struct brw_blorp_prog_data *prog_data,