We no longer need it.
While we are at it we mark the vs, gs, and wm codegen functions as static.
Reviewed-by: Eric Anholt <eric@anholt.net>
static bool
brw_codegen_cs_prog(struct brw_context *brw,
- struct gl_shader_program *prog,
struct brw_program *cp,
struct brw_cs_prog_key *key)
{
&key, sizeof(key),
&brw->cs.base.prog_offset,
&brw->cs.base.prog_data)) {
- bool success =
- brw_codegen_cs_prog(brw,
- ctx->_Shader->CurrentProgram[MESA_SHADER_COMPUTE],
- cp, &key);
+ bool success = brw_codegen_cs_prog(brw, cp, &key);
(void) success;
assert(success);
}
bool
-brw_cs_precompile(struct gl_context *ctx,
- struct gl_shader_program *shader_prog,
- struct gl_program *prog)
+brw_cs_precompile(struct gl_context *ctx, struct gl_program *prog)
{
struct brw_context *brw = brw_context(ctx);
struct brw_cs_prog_key key;
uint32_t old_prog_offset = brw->cs.base.prog_offset;
struct brw_stage_prog_data *old_prog_data = brw->cs.base.prog_data;
- bool success = brw_codegen_cs_prog(brw, shader_prog, bcp, &key);
+ bool success = brw_codegen_cs_prog(brw, bcp, &key);
brw->cs.base.prog_offset = old_prog_offset;
brw->cs.base.prog_data = old_prog_data;
&prog_data->base.base, reserved);
}
-bool
+static bool
brw_codegen_gs_prog(struct brw_context *brw,
- struct gl_shader_program *prog,
struct brw_program *gp,
struct brw_gs_prog_key *key)
{
void
brw_upload_gs_prog(struct brw_context *brw)
{
- struct gl_context *ctx = &brw->ctx;
- struct gl_shader_program **current = ctx->_Shader->CurrentProgram;
struct brw_stage_state *stage_state = &brw->gs.base;
struct brw_gs_prog_key key;
/* BRW_NEW_GEOMETRY_PROGRAM */
&key, sizeof(key),
&stage_state->prog_offset,
&brw->gs.base.prog_data)) {
- bool success = brw_codegen_gs_prog(brw, current[MESA_SHADER_GEOMETRY],
- gp, &key);
+ bool success = brw_codegen_gs_prog(brw, gp, &key);
assert(success);
(void)success;
}
}
bool
-brw_gs_precompile(struct gl_context *ctx,
- struct gl_shader_program *shader_prog,
- struct gl_program *prog)
+brw_gs_precompile(struct gl_context *ctx, struct gl_program *prog)
{
struct brw_context *brw = brw_context(ctx);
struct brw_gs_prog_key key;
brw_setup_tex_for_precompile(brw, &key.tex, prog);
key.program_string_id = bgp->id;
- success = brw_codegen_gs_prog(brw, shader_prog, bgp, &key);
+ success = brw_codegen_gs_prog(brw, bgp, &key);
brw->gs.base.prog_offset = old_prog_offset;
brw->gs.base.prog_data = old_prog_data;
brw_gs_populate_key(struct brw_context *brw,
struct brw_gs_prog_key *key);
-bool
-brw_codegen_gs_prog(struct brw_context *brw,
- struct gl_shader_program *prog,
- struct brw_program *gp,
- struct brw_gs_prog_key *key);
-
#ifdef __cplusplus
} /* extern "C" */
#endif
struct gl_linked_shader *fs = sh_prog->_LinkedShaders[MESA_SHADER_FRAGMENT];
struct gl_linked_shader *cs = sh_prog->_LinkedShaders[MESA_SHADER_COMPUTE];
- if (fs && !brw_fs_precompile(ctx, sh_prog, fs->Program))
+ if (fs && !brw_fs_precompile(ctx, fs->Program))
return false;
- if (gs && !brw_gs_precompile(ctx, sh_prog, gs->Program))
+ if (gs && !brw_gs_precompile(ctx, gs->Program))
return false;
if (tes && !brw_tes_precompile(ctx, sh_prog, tes->Program))
if (tcs && !brw_tcs_precompile(ctx, sh_prog, tcs->Program))
return false;
- if (vs && !brw_vs_precompile(ctx, sh_prog, vs->Program))
+ if (vs && !brw_vs_precompile(ctx, vs->Program))
return false;
- if (cs && !brw_cs_precompile(ctx, sh_prog, cs->Program))
+ if (cs && !brw_cs_precompile(ctx, cs->Program))
return false;
return true;
prog->nir = brw_create_nir(brw, NULL, prog, MESA_SHADER_FRAGMENT, true);
- brw_fs_precompile(ctx, NULL, prog);
+ brw_fs_precompile(ctx, prog);
break;
}
case GL_VERTEX_PROGRAM_ARB: {
prog->nir = brw_create_nir(brw, NULL, prog, MESA_SHADER_VERTEX,
compiler->scalar_stage[MESA_SHADER_VERTEX]);
- brw_vs_precompile(ctx, NULL, prog);
+ brw_vs_precompile(ctx, prog);
break;
}
default:
struct brw_stage_prog_data *stage_prog_data,
uint32_t next_binding_table_offset);
-bool brw_vs_precompile(struct gl_context *ctx,
- struct gl_shader_program *shader_prog,
- struct gl_program *prog);
+bool brw_vs_precompile(struct gl_context *ctx, struct gl_program *prog);
bool brw_tcs_precompile(struct gl_context *ctx,
struct gl_shader_program *shader_prog,
struct gl_program *prog);
bool brw_tes_precompile(struct gl_context *ctx,
struct gl_shader_program *shader_prog,
struct gl_program *prog);
-bool brw_gs_precompile(struct gl_context *ctx,
- struct gl_shader_program *shader_prog,
- struct gl_program *prog);
-bool brw_fs_precompile(struct gl_context *ctx,
- struct gl_shader_program *shader_prog,
- struct gl_program *prog);
-bool brw_cs_precompile(struct gl_context *ctx,
- struct gl_shader_program *shader_prog,
- struct gl_program *prog);
+bool brw_gs_precompile(struct gl_context *ctx, struct gl_program *prog);
+bool brw_fs_precompile(struct gl_context *ctx, struct gl_program *prog);
+bool brw_cs_precompile(struct gl_context *ctx, struct gl_program *prog);
GLboolean brw_link_shader(struct gl_context *ctx, struct gl_shader_program *prog);
struct gl_linked_shader *brw_new_shader(gl_shader_stage stage);
}
static bool
-brw_codegen_tcs_prog(struct brw_context *brw,
- struct gl_shader_program *shader_prog,
- struct brw_program *tcp,
- struct brw_program *tep,
- struct brw_tcs_prog_key *key)
+brw_codegen_tcs_prog(struct brw_context *brw, struct brw_program *tcp,
+ struct brw_program *tep, struct brw_tcs_prog_key *key)
{
struct gl_context *ctx = &brw->ctx;
const struct brw_compiler *compiler = brw->screen->compiler;
void
brw_upload_tcs_prog(struct brw_context *brw)
{
- struct gl_shader_program **current = brw->ctx._Shader->CurrentProgram;
struct brw_stage_state *stage_state = &brw->tcs.base;
struct brw_tcs_prog_key key;
/* BRW_NEW_TESS_PROGRAMS */
&key, sizeof(key),
&stage_state->prog_offset,
&brw->tcs.base.prog_data)) {
- bool success = brw_codegen_tcs_prog(brw, current[MESA_SHADER_TESS_CTRL],
- tcp, tep, &key);
+ bool success = brw_codegen_tcs_prog(brw, tcp, tep, &key);
assert(success);
(void)success;
}
key.outputs_written = prog->nir->info->outputs_written;
key.patch_outputs_written = prog->nir->info->patch_outputs_written;
- success = brw_codegen_tcs_prog(brw, shader_prog, btcp, btep, &key);
+ success = brw_codegen_tcs_prog(brw, btcp, btep, &key);
brw->tcs.base.prog_offset = old_prog_offset;
brw->tcs.base.prog_data = old_prog_data;
static bool
brw_codegen_tes_prog(struct brw_context *brw,
- struct gl_shader_program *shader_prog,
struct brw_program *tep,
struct brw_tes_prog_key *key)
{
void
brw_upload_tes_prog(struct brw_context *brw)
{
- struct gl_shader_program **current = brw->ctx._Shader->CurrentProgram;
struct brw_stage_state *stage_state = &brw->tes.base;
struct brw_tes_prog_key key;
/* BRW_NEW_TESS_PROGRAMS */
&key, sizeof(key),
&stage_state->prog_offset,
&brw->tes.base.prog_data)) {
- bool success = brw_codegen_tes_prog(brw, current[MESA_SHADER_TESS_EVAL],
- tep, &key);
+ bool success = brw_codegen_tes_prog(brw, tep, &key);
assert(success);
(void)success;
}
brw_setup_tex_for_precompile(brw, &key.tex, prog);
- success = brw_codegen_tes_prog(brw, shader_prog, btep, &key);
+ success = brw_codegen_tes_prog(brw, btep, &key);
brw->tes.base.prog_offset = old_prog_offset;
brw->tes.base.prog_data = old_prog_data;
}
}
-bool
+static bool
brw_codegen_vs_prog(struct brw_context *brw,
- struct gl_shader_program *prog,
struct brw_program *vp,
struct brw_vs_prog_key *key)
{
void
brw_upload_vs_prog(struct brw_context *brw)
{
- struct gl_context *ctx = &brw->ctx;
- struct gl_shader_program **current = ctx->_Shader->CurrentProgram;
struct brw_vs_prog_key key;
/* BRW_NEW_VERTEX_PROGRAM */
struct brw_program *vp = (struct brw_program *)brw->vertex_program;
if (!brw_search_cache(&brw->cache, BRW_CACHE_VS_PROG,
&key, sizeof(key),
&brw->vs.base.prog_offset, &brw->vs.base.prog_data)) {
- bool success = brw_codegen_vs_prog(brw, current[MESA_SHADER_VERTEX],
- vp, &key);
+ bool success = brw_codegen_vs_prog(brw, vp, &key);
(void) success;
assert(success);
}
}
bool
-brw_vs_precompile(struct gl_context *ctx,
- struct gl_shader_program *shader_prog,
- struct gl_program *prog)
+brw_vs_precompile(struct gl_context *ctx, struct gl_program *prog)
{
struct brw_context *brw = brw_context(ctx);
struct brw_vs_prog_key key;
(VARYING_BIT_COL0 | VARYING_BIT_COL1 | VARYING_BIT_BFC0 |
VARYING_BIT_BFC1));
- success = brw_codegen_vs_prog(brw, shader_prog, bvp, &key);
+ success = brw_codegen_vs_prog(brw, bvp, &key);
brw->vs.base.prog_offset = old_prog_offset;
brw->vs.base.prog_data = old_prog_data;
void
brw_upload_vs_prog(struct brw_context *brw);
-bool
-brw_codegen_vs_prog(struct brw_context *brw,
- struct gl_shader_program *prog,
- struct brw_program *vp,
- struct brw_vs_prog_key *key);
-
void
brw_vs_populate_key(struct brw_context *brw,
struct brw_vs_prog_key *key);
* Depending on the instructions used (i.e. flow control instructions)
* we'll use one of two code generators.
*/
-bool
+static bool
brw_codegen_wm_prog(struct brw_context *brw,
- struct gl_shader_program *prog,
struct brw_program *fp,
struct brw_wm_prog_key *key,
struct brw_vue_map *vue_map)
void
brw_upload_wm_prog(struct brw_context *brw)
{
- struct gl_context *ctx = &brw->ctx;
- struct gl_shader_program *current = ctx->_Shader->_CurrentFragmentProgram;
struct brw_wm_prog_key key;
struct brw_program *fp = (struct brw_program *) brw->fragment_program;
&key, sizeof(key),
&brw->wm.base.prog_offset,
&brw->wm.base.prog_data)) {
- bool success = brw_codegen_wm_prog(brw, current, fp, &key,
+ bool success = brw_codegen_wm_prog(brw, fp, &key,
&brw->vue_map_geom_out);
(void) success;
assert(success);
}
bool
-brw_fs_precompile(struct gl_context *ctx,
- struct gl_shader_program *shader_prog,
- struct gl_program *prog)
+brw_fs_precompile(struct gl_context *ctx, struct gl_program *prog)
{
struct brw_context *brw = brw_context(ctx);
struct brw_wm_prog_key key;
false);
}
- bool success = brw_codegen_wm_prog(brw, shader_prog, bfp, &key, &vue_map);
+ bool success = brw_codegen_wm_prog(brw, bfp, &key, &vue_map);
brw->wm.base.prog_offset = old_prog_offset;
brw->wm.base.prog_data = old_prog_data;
#endif
bool brw_color_buffer_write_enabled(struct brw_context *brw);
-bool brw_codegen_wm_prog(struct brw_context *brw,
- struct gl_shader_program *prog,
- struct brw_program *fp,
- struct brw_wm_prog_key *key,
- struct brw_vue_map *vue_map);
void
brw_upload_wm_prog(struct brw_context *brw);