i965/blorp: Take a blorp_context in compile_nir_shader

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
This commit is contained in:
Jason Ekstrand 2016-08-19 00:49:18 -07:00
parent a818a32244
commit 99b9e9b86e
6 changed files with 11 additions and 6 deletions

View File

@ -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 */

View File

@ -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;

View File

@ -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),

View File

@ -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),

View File

@ -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,

View File

@ -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;