i965: Rename do_<stage>_prog to brw_compile_<stage>_prog (and export)
This is in preparation for these functions to be called from other files. This commit is intended to have no functional change. It exists in preparation for some upcoming code movement in preparation for the shader cache. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
parent
a57672f18d
commit
b9b66985c3
|
@ -45,8 +45,9 @@
|
||||||
|
|
||||||
#include "util/ralloc.h"
|
#include "util/ralloc.h"
|
||||||
|
|
||||||
static void compile_ff_gs_prog(struct brw_context *brw,
|
void
|
||||||
struct brw_ff_gs_prog_key *key)
|
brw_compile_ff_gs_prog(struct brw_context *brw,
|
||||||
|
struct brw_ff_gs_prog_key *key)
|
||||||
{
|
{
|
||||||
struct brw_ff_gs_compile c;
|
struct brw_ff_gs_compile c;
|
||||||
const GLuint *program;
|
const GLuint *program;
|
||||||
|
@ -253,7 +254,7 @@ brw_upload_ff_gs_prog(struct brw_context *brw)
|
||||||
if (!brw_search_cache(&brw->cache, BRW_CACHE_FF_GS_PROG,
|
if (!brw_search_cache(&brw->cache, BRW_CACHE_FF_GS_PROG,
|
||||||
&key, sizeof(key),
|
&key, sizeof(key),
|
||||||
&brw->ff_gs.prog_offset, &brw->ff_gs.prog_data)) {
|
&brw->ff_gs.prog_offset, &brw->ff_gs.prog_data)) {
|
||||||
compile_ff_gs_prog( brw, &key );
|
brw_compile_ff_gs_prog(brw, &key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -115,4 +115,8 @@ void gen6_brw_upload_ff_gs_prog(struct brw_context *brw);
|
||||||
void
|
void
|
||||||
brw_upload_ff_gs_prog(struct brw_context *brw);
|
brw_upload_ff_gs_prog(struct brw_context *brw);
|
||||||
|
|
||||||
|
void
|
||||||
|
brw_compile_ff_gs_prog(struct brw_context *brw,
|
||||||
|
struct brw_ff_gs_prog_key *key);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -4152,7 +4152,7 @@ brw_fs_precompile(struct gl_context *ctx,
|
||||||
uint32_t old_prog_offset = brw->wm.base.prog_offset;
|
uint32_t old_prog_offset = brw->wm.base.prog_offset;
|
||||||
struct brw_wm_prog_data *old_prog_data = brw->wm.prog_data;
|
struct brw_wm_prog_data *old_prog_data = brw->wm.prog_data;
|
||||||
|
|
||||||
bool success = do_wm_prog(brw, shader_prog, bfp, &key);
|
bool success = brw_compile_wm_prog(brw, shader_prog, bfp, &key);
|
||||||
|
|
||||||
brw->wm.base.prog_offset = old_prog_offset;
|
brw->wm.base.prog_offset = old_prog_offset;
|
||||||
brw->wm.prog_data = old_prog_data;
|
brw->wm.prog_data = old_prog_data;
|
||||||
|
|
|
@ -34,11 +34,11 @@
|
||||||
#include "brw_ff_gs.h"
|
#include "brw_ff_gs.h"
|
||||||
|
|
||||||
|
|
||||||
static bool
|
bool
|
||||||
do_gs_prog(struct brw_context *brw,
|
brw_compile_gs_prog(struct brw_context *brw,
|
||||||
struct gl_shader_program *prog,
|
struct gl_shader_program *prog,
|
||||||
struct brw_geometry_program *gp,
|
struct brw_geometry_program *gp,
|
||||||
struct brw_gs_prog_key *key)
|
struct brw_gs_prog_key *key)
|
||||||
{
|
{
|
||||||
struct brw_stage_state *stage_state = &brw->gs.base;
|
struct brw_stage_state *stage_state = &brw->gs.base;
|
||||||
struct brw_gs_compile c;
|
struct brw_gs_compile c;
|
||||||
|
@ -326,6 +326,7 @@ void
|
||||||
brw_upload_gs_prog(struct brw_context *brw)
|
brw_upload_gs_prog(struct brw_context *brw)
|
||||||
{
|
{
|
||||||
struct gl_context *ctx = &brw->ctx;
|
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_stage_state *stage_state = &brw->gs.base;
|
||||||
struct brw_gs_prog_key key;
|
struct brw_gs_prog_key key;
|
||||||
/* BRW_NEW_GEOMETRY_PROGRAM */
|
/* BRW_NEW_GEOMETRY_PROGRAM */
|
||||||
|
@ -362,9 +363,8 @@ brw_upload_gs_prog(struct brw_context *brw)
|
||||||
if (!brw_search_cache(&brw->cache, BRW_CACHE_GS_PROG,
|
if (!brw_search_cache(&brw->cache, BRW_CACHE_GS_PROG,
|
||||||
&key, sizeof(key),
|
&key, sizeof(key),
|
||||||
&stage_state->prog_offset, &brw->gs.prog_data)) {
|
&stage_state->prog_offset, &brw->gs.prog_data)) {
|
||||||
bool success =
|
bool success = brw_compile_gs_prog(brw, current[MESA_SHADER_GEOMETRY],
|
||||||
do_gs_prog(brw, ctx->_Shader->CurrentProgram[MESA_SHADER_GEOMETRY], gp,
|
gp, &key);
|
||||||
&key);
|
|
||||||
assert(success);
|
assert(success);
|
||||||
(void)success;
|
(void)success;
|
||||||
}
|
}
|
||||||
|
@ -400,7 +400,7 @@ brw_gs_precompile(struct gl_context *ctx,
|
||||||
*/
|
*/
|
||||||
key.input_varyings = gp->Base.InputsRead;
|
key.input_varyings = gp->Base.InputsRead;
|
||||||
|
|
||||||
success = do_gs_prog(brw, shader_prog, bgp, &key);
|
success = brw_compile_gs_prog(brw, shader_prog, bgp, &key);
|
||||||
|
|
||||||
brw->gs.base.prog_offset = old_prog_offset;
|
brw->gs.base.prog_offset = old_prog_offset;
|
||||||
brw->gs.prog_data = old_prog_data;
|
brw->gs.prog_data = old_prog_data;
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
#include "brw_context.h"
|
#include "brw_context.h"
|
||||||
|
#include "brw_program.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
@ -41,6 +42,12 @@ bool brw_gs_prog_data_compare(const void *a, const void *b);
|
||||||
void
|
void
|
||||||
brw_upload_gs_prog(struct brw_context *brw);
|
brw_upload_gs_prog(struct brw_context *brw);
|
||||||
|
|
||||||
|
bool
|
||||||
|
brw_compile_gs_prog(struct brw_context *brw,
|
||||||
|
struct gl_shader_program *prog,
|
||||||
|
struct brw_geometry_program *gp,
|
||||||
|
struct brw_gs_prog_key *key);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
} /* extern "C" */
|
} /* extern "C" */
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -187,11 +187,11 @@ brw_vs_prog_data_compare(const void *in_a, const void *in_b)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
bool
|
||||||
do_vs_prog(struct brw_context *brw,
|
brw_compile_vs_prog(struct brw_context *brw,
|
||||||
struct gl_shader_program *prog,
|
struct gl_shader_program *prog,
|
||||||
struct brw_vertex_program *vp,
|
struct brw_vertex_program *vp,
|
||||||
struct brw_vs_prog_key *key)
|
struct brw_vs_prog_key *key)
|
||||||
{
|
{
|
||||||
GLuint program_size;
|
GLuint program_size;
|
||||||
const GLuint *program;
|
const GLuint *program;
|
||||||
|
@ -468,6 +468,7 @@ void
|
||||||
brw_upload_vs_prog(struct brw_context *brw)
|
brw_upload_vs_prog(struct brw_context *brw)
|
||||||
{
|
{
|
||||||
struct gl_context *ctx = &brw->ctx;
|
struct gl_context *ctx = &brw->ctx;
|
||||||
|
struct gl_shader_program **current = ctx->_Shader->CurrentProgram;
|
||||||
struct brw_vs_prog_key key;
|
struct brw_vs_prog_key key;
|
||||||
/* BRW_NEW_VERTEX_PROGRAM */
|
/* BRW_NEW_VERTEX_PROGRAM */
|
||||||
struct brw_vertex_program *vp =
|
struct brw_vertex_program *vp =
|
||||||
|
@ -481,9 +482,8 @@ brw_upload_vs_prog(struct brw_context *brw)
|
||||||
if (!brw_search_cache(&brw->cache, BRW_CACHE_VS_PROG,
|
if (!brw_search_cache(&brw->cache, BRW_CACHE_VS_PROG,
|
||||||
&key, sizeof(key),
|
&key, sizeof(key),
|
||||||
&brw->vs.base.prog_offset, &brw->vs.prog_data)) {
|
&brw->vs.base.prog_offset, &brw->vs.prog_data)) {
|
||||||
bool success =
|
bool success = brw_compile_vs_prog(brw, current[MESA_SHADER_VERTEX],
|
||||||
do_vs_prog(brw, ctx->_Shader->CurrentProgram[MESA_SHADER_VERTEX], vp,
|
vp, &key);
|
||||||
&key);
|
|
||||||
(void) success;
|
(void) success;
|
||||||
assert(success);
|
assert(success);
|
||||||
}
|
}
|
||||||
|
@ -524,7 +524,7 @@ brw_vs_precompile(struct gl_context *ctx,
|
||||||
(prog->OutputsWritten & (VARYING_BIT_COL0 | VARYING_BIT_COL1 |
|
(prog->OutputsWritten & (VARYING_BIT_COL0 | VARYING_BIT_COL1 |
|
||||||
VARYING_BIT_BFC0 | VARYING_BIT_BFC1));
|
VARYING_BIT_BFC0 | VARYING_BIT_BFC1));
|
||||||
|
|
||||||
success = do_vs_prog(brw, shader_prog, bvp, &key);
|
success = brw_compile_vs_prog(brw, shader_prog, bvp, &key);
|
||||||
|
|
||||||
brw->vs.base.prog_offset = old_prog_offset;
|
brw->vs.base.prog_offset = old_prog_offset;
|
||||||
brw->vs.prog_data = old_prog_data;
|
brw->vs.prog_data = old_prog_data;
|
||||||
|
|
|
@ -75,6 +75,12 @@ bool brw_vs_prog_data_compare(const void *a, const void *b);
|
||||||
void
|
void
|
||||||
brw_upload_vs_prog(struct brw_context *brw);
|
brw_upload_vs_prog(struct brw_context *brw);
|
||||||
|
|
||||||
|
bool
|
||||||
|
brw_compile_vs_prog(struct brw_context *brw,
|
||||||
|
struct gl_shader_program *prog,
|
||||||
|
struct brw_vertex_program *vp,
|
||||||
|
struct brw_vs_prog_key *key);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
} /* extern "C" */
|
} /* extern "C" */
|
||||||
|
|
||||||
|
|
|
@ -159,10 +159,11 @@ brw_wm_prog_data_compare(const void *in_a, const void *in_b)
|
||||||
* Depending on the instructions used (i.e. flow control instructions)
|
* Depending on the instructions used (i.e. flow control instructions)
|
||||||
* we'll use one of two code generators.
|
* we'll use one of two code generators.
|
||||||
*/
|
*/
|
||||||
bool do_wm_prog(struct brw_context *brw,
|
bool
|
||||||
struct gl_shader_program *prog,
|
brw_compile_wm_prog(struct brw_context *brw,
|
||||||
struct brw_fragment_program *fp,
|
struct gl_shader_program *prog,
|
||||||
struct brw_wm_prog_key *key)
|
struct brw_fragment_program *fp,
|
||||||
|
struct brw_wm_prog_key *key)
|
||||||
{
|
{
|
||||||
struct gl_context *ctx = &brw->ctx;
|
struct gl_context *ctx = &brw->ctx;
|
||||||
void *mem_ctx = ralloc_context(NULL);
|
void *mem_ctx = ralloc_context(NULL);
|
||||||
|
@ -607,6 +608,7 @@ void
|
||||||
brw_upload_wm_prog(struct brw_context *brw)
|
brw_upload_wm_prog(struct brw_context *brw)
|
||||||
{
|
{
|
||||||
struct gl_context *ctx = &brw->ctx;
|
struct gl_context *ctx = &brw->ctx;
|
||||||
|
struct gl_shader_program *current = ctx->_Shader->_CurrentFragmentProgram;
|
||||||
struct brw_wm_prog_key key;
|
struct brw_wm_prog_key key;
|
||||||
struct brw_fragment_program *fp = (struct brw_fragment_program *)
|
struct brw_fragment_program *fp = (struct brw_fragment_program *)
|
||||||
brw->fragment_program;
|
brw->fragment_program;
|
||||||
|
@ -619,8 +621,7 @@ brw_upload_wm_prog(struct brw_context *brw)
|
||||||
if (!brw_search_cache(&brw->cache, BRW_CACHE_FS_PROG,
|
if (!brw_search_cache(&brw->cache, BRW_CACHE_FS_PROG,
|
||||||
&key, sizeof(key),
|
&key, sizeof(key),
|
||||||
&brw->wm.base.prog_offset, &brw->wm.prog_data)) {
|
&brw->wm.base.prog_offset, &brw->wm.prog_data)) {
|
||||||
bool success = do_wm_prog(brw, ctx->_Shader->_CurrentFragmentProgram, fp,
|
bool success = brw_compile_wm_prog(brw, current, fp, &key);
|
||||||
&key);
|
|
||||||
(void) success;
|
(void) success;
|
||||||
assert(success);
|
assert(success);
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,10 +78,10 @@ GLboolean brw_link_shader(struct gl_context *ctx, struct gl_shader_program *prog
|
||||||
struct gl_shader *brw_new_shader(struct gl_context *ctx, GLuint name, GLuint type);
|
struct gl_shader *brw_new_shader(struct gl_context *ctx, GLuint name, GLuint type);
|
||||||
|
|
||||||
bool brw_color_buffer_write_enabled(struct brw_context *brw);
|
bool brw_color_buffer_write_enabled(struct brw_context *brw);
|
||||||
bool do_wm_prog(struct brw_context *brw,
|
bool brw_compile_wm_prog(struct brw_context *brw,
|
||||||
struct gl_shader_program *prog,
|
struct gl_shader_program *prog,
|
||||||
struct brw_fragment_program *fp,
|
struct brw_fragment_program *fp,
|
||||||
struct brw_wm_prog_key *key);
|
struct brw_wm_prog_key *key);
|
||||||
void brw_wm_debug_recompile(struct brw_context *brw,
|
void brw_wm_debug_recompile(struct brw_context *brw,
|
||||||
struct gl_shader_program *prog,
|
struct gl_shader_program *prog,
|
||||||
const struct brw_wm_prog_key *key);
|
const struct brw_wm_prog_key *key);
|
||||||
|
|
Loading…
Reference in New Issue