From: Jason Ekstrand Date: Fri, 19 Aug 2016 07:49:18 +0000 (-0700) Subject: i965/blorp: Take a blorp_context in compile_nir_shader X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=99b9e9b86ef7277c4953853da8e51e3f7a254a74;p=mesa.git i965/blorp: Take a blorp_context in compile_nir_shader Signed-off-by: Jason Ekstrand Reviewed-by: Topi Pohjolainen --- diff --git a/src/mesa/drivers/dri/i965/blorp.c b/src/mesa/drivers/dri/i965/blorp.c index e655f8dd226..e81b9ebc366 100644 --- a/src/mesa/drivers/dri/i965/blorp.c +++ b/src/mesa/drivers/dri/i965/blorp.c @@ -170,13 +170,13 @@ nir_uniform_type_size(const struct glsl_type *type) } const unsigned * -brw_blorp_compile_nir_shader(struct brw_context *brw, struct nir_shader *nir, +brw_blorp_compile_nir_shader(struct blorp_context *blorp, struct nir_shader *nir, const struct brw_wm_prog_key *wm_key, bool use_repclear, struct brw_blorp_prog_data *prog_data, unsigned *program_size) { - const struct brw_compiler *compiler = brw->intelScreen->compiler; + const struct brw_compiler *compiler = blorp->compiler; void *mem_ctx = ralloc_context(NULL); @@ -216,7 +216,8 @@ brw_blorp_compile_nir_shader(struct brw_context *brw, struct nir_shader *nir, nir_lower_io(nir, nir_var_uniform, nir_uniform_type_size); const unsigned *program = - brw_compile_fs(compiler, brw, mem_ctx, wm_key, &wm_prog_data, nir, + brw_compile_fs(compiler, blorp->driver_ctx, mem_ctx, + wm_key, &wm_prog_data, nir, NULL, -1, -1, false, use_repclear, program_size, NULL); /* Copy the relavent bits of wm_prog_data over into the blorp prog data */ diff --git a/src/mesa/drivers/dri/i965/blorp.h b/src/mesa/drivers/dri/i965/blorp.h index 45648e3f699..865ac00aac9 100644 --- a/src/mesa/drivers/dri/i965/blorp.h +++ b/src/mesa/drivers/dri/i965/blorp.h @@ -45,6 +45,8 @@ struct blorp_context { const struct isl_device *isl_dev; + const struct brw_compiler *compiler; + struct { uint32_t tex; uint32_t rb; diff --git a/src/mesa/drivers/dri/i965/blorp_blit.c b/src/mesa/drivers/dri/i965/blorp_blit.c index d8612524609..598f9d788ad 100644 --- a/src/mesa/drivers/dri/i965/blorp_blit.c +++ b/src/mesa/drivers/dri/i965/blorp_blit.c @@ -1214,7 +1214,7 @@ brw_blorp_get_blit_kernel(struct brw_context *brw, wm_key.tex.msaa_16 = prog_key->tex_samples == 16; wm_key.multisample_fbo = prog_key->rt_samples > 1; - program = brw_blorp_compile_nir_shader(brw, nir, &wm_key, false, + program = brw_blorp_compile_nir_shader(&brw->blorp, nir, &wm_key, false, &prog_data, &program_size); brw->blorp.upload_shader(&brw->blorp, prog_key, sizeof(*prog_key), diff --git a/src/mesa/drivers/dri/i965/blorp_clear.c b/src/mesa/drivers/dri/i965/blorp_clear.c index 73b55bd0920..8bd2b5b52d2 100644 --- a/src/mesa/drivers/dri/i965/blorp_clear.c +++ b/src/mesa/drivers/dri/i965/blorp_clear.c @@ -83,7 +83,7 @@ brw_blorp_params_get_clear_kernel(struct brw_context *brw, struct brw_blorp_prog_data prog_data; unsigned program_size; const unsigned *program = - brw_blorp_compile_nir_shader(brw, b.shader, &wm_key, use_replicated_data, + brw_blorp_compile_nir_shader(&brw->blorp, b.shader, &wm_key, use_replicated_data, &prog_data, &program_size); brw->blorp.upload_shader(&brw->blorp, &blorp_key, sizeof(blorp_key), diff --git a/src/mesa/drivers/dri/i965/blorp_priv.h b/src/mesa/drivers/dri/i965/blorp_priv.h index f6a82a66e7f..a28b5a7b73f 100644 --- a/src/mesa/drivers/dri/i965/blorp_priv.h +++ b/src/mesa/drivers/dri/i965/blorp_priv.h @@ -274,7 +274,7 @@ struct brw_blorp_blit_prog_key void brw_blorp_init_wm_prog_key(struct brw_wm_prog_key *wm_key); const unsigned * -brw_blorp_compile_nir_shader(struct brw_context *brw, struct nir_shader *nir, +brw_blorp_compile_nir_shader(struct blorp_context *blorp, struct nir_shader *nir, const struct brw_wm_prog_key *wm_key, bool use_repclear, struct brw_blorp_prog_data *prog_data, diff --git a/src/mesa/drivers/dri/i965/brw_blorp.c b/src/mesa/drivers/dri/i965/brw_blorp.c index d2f24a65ca2..e509417e621 100644 --- a/src/mesa/drivers/dri/i965/brw_blorp.c +++ b/src/mesa/drivers/dri/i965/brw_blorp.c @@ -66,6 +66,8 @@ brw_blorp_init(struct brw_context *brw) { blorp_init(&brw->blorp, brw, &brw->isl_dev); + brw->blorp.compiler = brw->intelScreen->compiler; + switch (brw->gen) { case 6: brw->blorp.mocs.tex = 0;