This lets us get devinfo and other misc. compiler settings.
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
}
void
-brw_cs_populate_default_key(const struct gen_device_info *devinfo,
+brw_cs_populate_default_key(const struct brw_compiler *compiler,
struct brw_cs_prog_key *key,
struct gl_program *prog)
{
+ const struct gen_device_info *devinfo = compiler->devinfo;
memset(key, 0, sizeof(*key));
key->program_string_id = brw_program(prog)->id;
struct brw_program *bcp = brw_program(prog);
- brw_cs_populate_default_key(&brw->screen->devinfo, &key, prog);
+ brw_cs_populate_default_key(brw->screen->compiler, &key, prog);
uint32_t old_prog_offset = brw->cs.base.prog_offset;
struct brw_stage_prog_data *old_prog_data = brw->cs.base.prog_data;
void
brw_cs_populate_key(struct brw_context *brw, struct brw_cs_prog_key *key);
void
-brw_cs_populate_default_key(const struct gen_device_info *devinfo,
+brw_cs_populate_default_key(const struct brw_compiler *compiler,
struct brw_cs_prog_key *key,
struct gl_program *prog);
}
void
-brw_gs_populate_default_key(const struct gen_device_info *devinfo,
+brw_gs_populate_default_key(const struct brw_compiler *compiler,
struct brw_gs_prog_key *key,
struct gl_program *prog)
{
+ const struct gen_device_info *devinfo = compiler->devinfo;
+
memset(key, 0, sizeof(*key));
brw_setup_tex_for_precompile(devinfo, &key->tex, prog);
struct brw_program *bgp = brw_program(prog);
- brw_gs_populate_default_key(&brw->screen->devinfo, &key, prog);
+ brw_gs_populate_default_key(brw->screen->compiler, &key, prog);
success = brw_codegen_gs_prog(brw, bgp, &key);
brw_gs_populate_key(struct brw_context *brw,
struct brw_gs_prog_key *key);
void
-brw_gs_populate_default_key(const struct gen_device_info *devinfo,
+brw_gs_populate_default_key(const struct brw_compiler *compiler,
struct brw_gs_prog_key *key,
struct gl_program *prog);
}
void
-brw_populate_default_key(const struct gen_device_info *devinfo,
+brw_populate_default_key(const struct brw_compiler *compiler,
union brw_any_prog_key *prog_key,
struct gl_shader_program *sh_prog,
struct gl_program *prog)
{
switch (prog->info.stage) {
case MESA_SHADER_VERTEX:
- brw_vs_populate_default_key(devinfo, &prog_key->vs, prog);
+ brw_vs_populate_default_key(compiler, &prog_key->vs, prog);
break;
case MESA_SHADER_TESS_CTRL:
- brw_tcs_populate_default_key(devinfo, &prog_key->tcs, sh_prog, prog);
+ brw_tcs_populate_default_key(compiler, &prog_key->tcs, sh_prog, prog);
break;
case MESA_SHADER_TESS_EVAL:
- brw_tes_populate_default_key(devinfo, &prog_key->tes, sh_prog, prog);
+ brw_tes_populate_default_key(compiler, &prog_key->tes, sh_prog, prog);
break;
case MESA_SHADER_GEOMETRY:
- brw_gs_populate_default_key(devinfo, &prog_key->gs, prog);
+ brw_gs_populate_default_key(compiler, &prog_key->gs, prog);
break;
case MESA_SHADER_FRAGMENT:
- brw_wm_populate_default_key(devinfo, &prog_key->wm, prog);
+ brw_wm_populate_default_key(compiler, &prog_key->wm, prog);
break;
case MESA_SHADER_COMPUTE:
- brw_cs_populate_default_key(devinfo, &prog_key->cs, prog);
+ brw_cs_populate_default_key(compiler, &prog_key->cs, prog);
break;
default:
unreachable("Unsupported stage!");
unsigned id);
void
-brw_populate_default_key(const struct gen_device_info *devinfo,
+brw_populate_default_key(const struct brw_compiler *compiler,
union brw_any_prog_key *prog_key,
struct gl_shader_program *sh_prog,
struct gl_program *prog);
void brw_upload_tcs_prog(struct brw_context *brw);
void brw_tcs_populate_key(struct brw_context *brw,
struct brw_tcs_prog_key *key);
-void brw_tcs_populate_default_key(const struct gen_device_info *devinfo,
+void brw_tcs_populate_default_key(const struct brw_compiler *compiler,
struct brw_tcs_prog_key *key,
struct gl_shader_program *sh_prog,
struct gl_program *prog);
void brw_upload_tes_prog(struct brw_context *brw);
void brw_tes_populate_key(struct brw_context *brw,
struct brw_tes_prog_key *key);
-void brw_tes_populate_default_key(const struct gen_device_info *devinfo,
+void brw_tes_populate_default_key(const struct brw_compiler *compiler,
struct brw_tes_prog_key *key,
struct gl_shader_program *sh_prog,
struct gl_program *prog);
struct brw_context *brw = brw_context(ctx);
union brw_any_prog_key key;
- brw_populate_default_key(&brw->screen->devinfo, &key, sh_prog, prog);
+ brw_populate_default_key(brw->screen->compiler, &key, sh_prog, prog);
const gl_shader_stage stage = prog->info.stage;
uint32_t offset = 0;
}
void
-brw_tcs_populate_default_key(const struct gen_device_info *devinfo,
+brw_tcs_populate_default_key(const struct brw_compiler *compiler,
struct brw_tcs_prog_key *key,
struct gl_shader_program *sh_prog,
struct gl_program *prog)
{
+ const struct gen_device_info *devinfo = compiler->devinfo;
struct brw_program *btcp = brw_program(prog);
const struct gl_linked_shader *tes =
sh_prog->_LinkedShaders[MESA_SHADER_TESS_EVAL];
struct gl_program *prog)
{
struct brw_context *brw = brw_context(ctx);
+ const struct brw_compiler *compiler = brw->screen->compiler;
struct brw_tcs_prog_key key;
uint32_t old_prog_offset = brw->tcs.base.prog_offset;
struct brw_stage_prog_data *old_prog_data = brw->tcs.base.prog_data;
shader_prog->_LinkedShaders[MESA_SHADER_TESS_EVAL];
struct brw_program *btep = tes ? brw_program(tes->Program) : NULL;
- brw_tcs_populate_default_key(&brw->screen->devinfo, &key, shader_prog, prog);
+ brw_tcs_populate_default_key(compiler, &key, shader_prog, prog);
success = brw_codegen_tcs_prog(brw, btcp, btep, &key);
}
void
-brw_tes_populate_default_key(const struct gen_device_info *devinfo,
+brw_tes_populate_default_key(const struct brw_compiler *compiler,
struct brw_tes_prog_key *key,
struct gl_shader_program *sh_prog,
struct gl_program *prog)
{
+ const struct gen_device_info *devinfo = compiler->devinfo;
struct brw_program *btep = brw_program(prog);
memset(key, 0, sizeof(*key));
struct gl_program *prog)
{
struct brw_context *brw = brw_context(ctx);
+ const struct brw_compiler *compiler = brw->screen->compiler;
struct brw_tes_prog_key key;
uint32_t old_prog_offset = brw->tes.base.prog_offset;
struct brw_stage_prog_data *old_prog_data = brw->tes.base.prog_data;
struct brw_program *btep = brw_program(prog);
- brw_tes_populate_default_key(&brw->screen->devinfo, &key, shader_prog, prog);
+ brw_tes_populate_default_key(compiler, &key, shader_prog, prog);
success = brw_codegen_tes_prog(brw, btep, &key);
}
void
-brw_vs_populate_default_key(const struct gen_device_info *devinfo,
+brw_vs_populate_default_key(const struct brw_compiler *compiler,
struct brw_vs_prog_key *key,
struct gl_program *prog)
{
+ const struct gen_device_info *devinfo = compiler->devinfo;
struct brw_program *bvp = brw_program(prog);
memset(key, 0, sizeof(*key));
struct brw_program *bvp = brw_program(prog);
- brw_vs_populate_default_key(&brw->screen->devinfo, &key, prog);
+ brw_vs_populate_default_key(brw->screen->compiler, &key, prog);
success = brw_codegen_vs_prog(brw, bvp, &key);
brw_vs_populate_key(struct brw_context *brw,
struct brw_vs_prog_key *key);
void
-brw_vs_populate_default_key(const struct gen_device_info *devinfo,
+brw_vs_populate_default_key(const struct brw_compiler *compiler,
struct brw_vs_prog_key *key,
struct gl_program *prog);
}
void
-brw_wm_populate_default_key(const struct gen_device_info *devinfo,
+brw_wm_populate_default_key(const struct brw_compiler *compiler,
struct brw_wm_prog_key *key,
struct gl_program *prog)
{
+ const struct gen_device_info *devinfo = compiler->devinfo;
+
memset(key, 0, sizeof(*key));
uint64_t outputs_written = prog->info.outputs_written;
struct brw_program *bfp = brw_program(prog);
- brw_wm_populate_default_key(&brw->screen->devinfo, &key, prog);
+ brw_wm_populate_default_key(brw->screen->compiler, &key, prog);
/* check brw_wm_populate_default_key coherent_fb_fetch setting */
assert(key.coherent_fb_fetch ==
brw_wm_populate_key(struct brw_context *brw,
struct brw_wm_prog_key *key);
void
-brw_wm_populate_default_key(const struct gen_device_info *devinfo,
+brw_wm_populate_default_key(const struct brw_compiler *compiler,
struct brw_wm_prog_key *key,
struct gl_program *prog);