i965: Add _CACHE_ in brw_cache_id enum names.
BRW_CACHE_VS_PROG is more easily associated with program caches than plain BRW_VS_PROG. While we're at it, rename BRW_WM_PROG to BRW_CACHE_FS_PROG, to move away from the outdated Windowizer/Masker name. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Matt Turner <mattst88@gmail.com>
This commit is contained in:
parent
e563c33d57
commit
67c498086d
|
@ -2119,14 +2119,14 @@ brw_blorp_blit_params::get_wm_prog(struct brw_context *brw,
|
||||||
brw_blorp_prog_data **prog_data) const
|
brw_blorp_prog_data **prog_data) const
|
||||||
{
|
{
|
||||||
uint32_t prog_offset = 0;
|
uint32_t prog_offset = 0;
|
||||||
if (!brw_search_cache(&brw->cache, BRW_BLORP_BLIT_PROG,
|
if (!brw_search_cache(&brw->cache, BRW_CACHE_BLORP_BLIT_PROG,
|
||||||
&this->wm_prog_key, sizeof(this->wm_prog_key),
|
&this->wm_prog_key, sizeof(this->wm_prog_key),
|
||||||
&prog_offset, prog_data)) {
|
&prog_offset, prog_data)) {
|
||||||
brw_blorp_blit_program prog(brw, &this->wm_prog_key,
|
brw_blorp_blit_program prog(brw, &this->wm_prog_key,
|
||||||
INTEL_DEBUG & DEBUG_BLORP);
|
INTEL_DEBUG & DEBUG_BLORP);
|
||||||
GLuint program_size;
|
GLuint program_size;
|
||||||
const GLuint *program = prog.compile(brw, &program_size);
|
const GLuint *program = prog.compile(brw, &program_size);
|
||||||
brw_upload_cache(&brw->cache, BRW_BLORP_BLIT_PROG,
|
brw_upload_cache(&brw->cache, BRW_CACHE_BLORP_BLIT_PROG,
|
||||||
&this->wm_prog_key, sizeof(this->wm_prog_key),
|
&this->wm_prog_key, sizeof(this->wm_prog_key),
|
||||||
program, program_size,
|
program, program_size,
|
||||||
&prog.prog_data, sizeof(prog.prog_data),
|
&prog.prog_data, sizeof(prog.prog_data),
|
||||||
|
|
|
@ -122,7 +122,7 @@ static void compile_clip_prog( struct brw_context *brw,
|
||||||
}
|
}
|
||||||
|
|
||||||
brw_upload_cache(&brw->cache,
|
brw_upload_cache(&brw->cache,
|
||||||
BRW_CLIP_PROG,
|
BRW_CACHE_CLIP_PROG,
|
||||||
&c.key, sizeof(c.key),
|
&c.key, sizeof(c.key),
|
||||||
program, program_size,
|
program, program_size,
|
||||||
&c.prog_data, sizeof(c.prog_data),
|
&c.prog_data, sizeof(c.prog_data),
|
||||||
|
@ -248,7 +248,7 @@ brw_upload_clip_prog(struct brw_context *brw)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!brw_search_cache(&brw->cache, BRW_CLIP_PROG,
|
if (!brw_search_cache(&brw->cache, BRW_CACHE_CLIP_PROG,
|
||||||
&key, sizeof(key),
|
&key, sizeof(key),
|
||||||
&brw->clip.prog_offset, &brw->clip.prog_data)) {
|
&brw->clip.prog_offset, &brw->clip.prog_data)) {
|
||||||
compile_clip_prog( brw, &key );
|
compile_clip_prog( brw, &key );
|
||||||
|
|
|
@ -693,13 +693,13 @@ struct brw_gs_prog_data
|
||||||
#define SHADER_TIME_STRIDE 64
|
#define SHADER_TIME_STRIDE 64
|
||||||
|
|
||||||
enum brw_cache_id {
|
enum brw_cache_id {
|
||||||
BRW_WM_PROG,
|
BRW_CACHE_FS_PROG,
|
||||||
BRW_BLORP_BLIT_PROG,
|
BRW_CACHE_BLORP_BLIT_PROG,
|
||||||
BRW_SF_PROG,
|
BRW_CACHE_SF_PROG,
|
||||||
BRW_VS_PROG,
|
BRW_CACHE_VS_PROG,
|
||||||
BRW_FF_GS_PROG,
|
BRW_CACHE_FF_GS_PROG,
|
||||||
BRW_GS_PROG,
|
BRW_CACHE_GS_PROG,
|
||||||
BRW_CLIP_PROG,
|
BRW_CACHE_CLIP_PROG,
|
||||||
|
|
||||||
BRW_MAX_CACHE
|
BRW_MAX_CACHE
|
||||||
};
|
};
|
||||||
|
@ -777,13 +777,13 @@ enum shader_time_shader_type {
|
||||||
|
|
||||||
/* Flags for brw->state.cache.
|
/* Flags for brw->state.cache.
|
||||||
*/
|
*/
|
||||||
#define CACHE_NEW_WM_PROG (1<<BRW_WM_PROG)
|
#define CACHE_NEW_WM_PROG (1 << BRW_CACHE_FS_PROG)
|
||||||
#define CACHE_NEW_BLORP_BLIT_PROG (1<<BRW_BLORP_BLIT_PROG)
|
#define CACHE_NEW_BLORP_BLIT_PROG (1 << BRW_CACHE_BLORP_BLIT_PROG)
|
||||||
#define CACHE_NEW_SF_PROG (1<<BRW_SF_PROG)
|
#define CACHE_NEW_SF_PROG (1 << BRW_CACHE_SF_PROG)
|
||||||
#define CACHE_NEW_VS_PROG (1<<BRW_VS_PROG)
|
#define CACHE_NEW_VS_PROG (1 << BRW_CACHE_VS_PROG)
|
||||||
#define CACHE_NEW_FF_GS_PROG (1<<BRW_FF_GS_PROG)
|
#define CACHE_NEW_FF_GS_PROG (1 << BRW_CACHE_FF_GS_PROG)
|
||||||
#define CACHE_NEW_GS_PROG (1<<BRW_GS_PROG)
|
#define CACHE_NEW_GS_PROG (1 << BRW_CACHE_GS_PROG)
|
||||||
#define CACHE_NEW_CLIP_PROG (1<<BRW_CLIP_PROG)
|
#define CACHE_NEW_CLIP_PROG (1 << BRW_CACHE_CLIP_PROG)
|
||||||
|
|
||||||
struct brw_vertex_buffer {
|
struct brw_vertex_buffer {
|
||||||
/** Buffer object containing the uploaded vertex data */
|
/** Buffer object containing the uploaded vertex data */
|
||||||
|
|
|
@ -139,7 +139,7 @@ static void compile_ff_gs_prog(struct brw_context *brw,
|
||||||
fprintf(stderr, "\n");
|
fprintf(stderr, "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
brw_upload_cache(&brw->cache, BRW_FF_GS_PROG,
|
brw_upload_cache(&brw->cache, BRW_CACHE_FF_GS_PROG,
|
||||||
&c.key, sizeof(c.key),
|
&c.key, sizeof(c.key),
|
||||||
program, program_size,
|
program, program_size,
|
||||||
&c.prog_data, sizeof(c.prog_data),
|
&c.prog_data, sizeof(c.prog_data),
|
||||||
|
@ -235,7 +235,7 @@ brw_upload_ff_gs_prog(struct brw_context *brw)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (brw->ff_gs.prog_active) {
|
if (brw->ff_gs.prog_active) {
|
||||||
if (!brw_search_cache(&brw->cache, BRW_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 );
|
compile_ff_gs_prog( brw, &key );
|
||||||
|
|
|
@ -282,7 +282,7 @@ do_gs_prog(struct brw_context *brw,
|
||||||
brw->max_gs_threads);
|
brw->max_gs_threads);
|
||||||
}
|
}
|
||||||
|
|
||||||
brw_upload_cache(&brw->cache, BRW_GS_PROG,
|
brw_upload_cache(&brw->cache, BRW_CACHE_GS_PROG,
|
||||||
&c.key, sizeof(c.key),
|
&c.key, sizeof(c.key),
|
||||||
program, program_size,
|
program, program_size,
|
||||||
&c.prog_data, sizeof(c.prog_data),
|
&c.prog_data, sizeof(c.prog_data),
|
||||||
|
@ -343,7 +343,7 @@ brw_upload_gs_prog(struct brw_context *brw)
|
||||||
/* BRW_NEW_VUE_MAP_VS */
|
/* BRW_NEW_VUE_MAP_VS */
|
||||||
key.input_varyings = brw->vue_map_vs.slots_valid;
|
key.input_varyings = brw->vue_map_vs.slots_valid;
|
||||||
|
|
||||||
if (!brw_search_cache(&brw->cache, BRW_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 =
|
||||||
|
|
|
@ -123,7 +123,7 @@ static void compile_sf_prog( struct brw_context *brw,
|
||||||
fprintf(stderr, "\n");
|
fprintf(stderr, "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
brw_upload_cache(&brw->cache, BRW_SF_PROG,
|
brw_upload_cache(&brw->cache, BRW_CACHE_SF_PROG,
|
||||||
&c.key, sizeof(c.key),
|
&c.key, sizeof(c.key),
|
||||||
program, program_size,
|
program, program_size,
|
||||||
&c.prog_data, sizeof(c.prog_data),
|
&c.prog_data, sizeof(c.prog_data),
|
||||||
|
@ -207,7 +207,7 @@ brw_upload_sf_prog(struct brw_context *brw)
|
||||||
key.frontface_ccw = (ctx->Polygon.FrontFace == GL_CCW) != render_to_fbo;
|
key.frontface_ccw = (ctx->Polygon.FrontFace == GL_CCW) != render_to_fbo;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!brw_search_cache(&brw->cache, BRW_SF_PROG,
|
if (!brw_search_cache(&brw->cache, BRW_CACHE_SF_PROG,
|
||||||
&key, sizeof(key),
|
&key, sizeof(key),
|
||||||
&brw->sf.prog_offset, &brw->sf.prog_data)) {
|
&brw->sf.prog_offset, &brw->sf.prog_data)) {
|
||||||
compile_sf_prog( brw, &key );
|
compile_sf_prog( brw, &key );
|
||||||
|
|
|
@ -360,12 +360,12 @@ brw_init_caches(struct brw_context *brw)
|
||||||
if (brw->has_llc)
|
if (brw->has_llc)
|
||||||
drm_intel_gem_bo_map_unsynchronized(cache->bo);
|
drm_intel_gem_bo_map_unsynchronized(cache->bo);
|
||||||
|
|
||||||
cache->aux_compare[BRW_VS_PROG] = brw_vs_prog_data_compare;
|
cache->aux_compare[BRW_CACHE_VS_PROG] = brw_vs_prog_data_compare;
|
||||||
cache->aux_compare[BRW_GS_PROG] = brw_gs_prog_data_compare;
|
cache->aux_compare[BRW_CACHE_GS_PROG] = brw_gs_prog_data_compare;
|
||||||
cache->aux_compare[BRW_WM_PROG] = brw_wm_prog_data_compare;
|
cache->aux_compare[BRW_CACHE_FS_PROG] = brw_wm_prog_data_compare;
|
||||||
cache->aux_free[BRW_VS_PROG] = brw_stage_prog_data_free;
|
cache->aux_free[BRW_CACHE_VS_PROG] = brw_stage_prog_data_free;
|
||||||
cache->aux_free[BRW_GS_PROG] = brw_stage_prog_data_free;
|
cache->aux_free[BRW_CACHE_GS_PROG] = brw_stage_prog_data_free;
|
||||||
cache->aux_free[BRW_WM_PROG] = brw_stage_prog_data_free;
|
cache->aux_free[BRW_CACHE_FS_PROG] = brw_stage_prog_data_free;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -472,23 +472,23 @@ dump_prog_cache(struct brw_context *brw)
|
||||||
const char *name;
|
const char *name;
|
||||||
|
|
||||||
switch (item->cache_id) {
|
switch (item->cache_id) {
|
||||||
case BRW_VS_PROG:
|
case BRW_CACHE_VS_PROG:
|
||||||
name = "VS kernel";
|
name = "VS kernel";
|
||||||
break;
|
break;
|
||||||
case BRW_FF_GS_PROG:
|
case BRW_CACHE_FF_GS_PROG:
|
||||||
name = "Fixed-function GS kernel";
|
name = "Fixed-function GS kernel";
|
||||||
break;
|
break;
|
||||||
case BRW_GS_PROG:
|
case BRW_CACHE_GS_PROG:
|
||||||
name = "GS kernel";
|
name = "GS kernel";
|
||||||
break;
|
break;
|
||||||
case BRW_CLIP_PROG:
|
case BRW_CACHE_CLIP_PROG:
|
||||||
name = "CLIP kernel";
|
name = "CLIP kernel";
|
||||||
break;
|
break;
|
||||||
case BRW_SF_PROG:
|
case BRW_CACHE_SF_PROG:
|
||||||
name = "SF kernel";
|
name = "SF kernel";
|
||||||
break;
|
break;
|
||||||
case BRW_WM_PROG:
|
case BRW_CACHE_FS_PROG:
|
||||||
name = "WM kernel";
|
name = "FS kernel";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
name = "unknown";
|
name = "unknown";
|
||||||
|
|
|
@ -312,7 +312,7 @@ do_vs_prog(struct brw_context *brw,
|
||||||
brw->max_vs_threads);
|
brw->max_vs_threads);
|
||||||
}
|
}
|
||||||
|
|
||||||
brw_upload_cache(&brw->cache, BRW_VS_PROG,
|
brw_upload_cache(&brw->cache, BRW_CACHE_VS_PROG,
|
||||||
&c.key, sizeof(c.key),
|
&c.key, sizeof(c.key),
|
||||||
program, program_size,
|
program, program_size,
|
||||||
&prog_data, sizeof(prog_data),
|
&prog_data, sizeof(prog_data),
|
||||||
|
@ -345,7 +345,7 @@ brw_vs_debug_recompile(struct brw_context *brw,
|
||||||
|
|
||||||
for (unsigned int i = 0; i < brw->cache.size; i++) {
|
for (unsigned int i = 0; i < brw->cache.size; i++) {
|
||||||
for (c = brw->cache.items[i]; c; c = c->next) {
|
for (c = brw->cache.items[i]; c; c = c->next) {
|
||||||
if (c->cache_id == BRW_VS_PROG) {
|
if (c->cache_id == BRW_CACHE_VS_PROG) {
|
||||||
old_key = c->key;
|
old_key = c->key;
|
||||||
|
|
||||||
if (old_key->base.program_string_id == key->base.program_string_id)
|
if (old_key->base.program_string_id == key->base.program_string_id)
|
||||||
|
@ -483,7 +483,7 @@ static void brw_upload_vs_prog(struct brw_context *brw)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!brw_search_cache(&brw->cache, BRW_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 =
|
||||||
|
|
|
@ -199,7 +199,7 @@ bool do_wm_prog(struct brw_context *brw,
|
||||||
if (unlikely(INTEL_DEBUG & DEBUG_WM))
|
if (unlikely(INTEL_DEBUG & DEBUG_WM))
|
||||||
fprintf(stderr, "\n");
|
fprintf(stderr, "\n");
|
||||||
|
|
||||||
brw_upload_cache(&brw->cache, BRW_WM_PROG,
|
brw_upload_cache(&brw->cache, BRW_CACHE_FS_PROG,
|
||||||
key, sizeof(struct brw_wm_prog_key),
|
key, sizeof(struct brw_wm_prog_key),
|
||||||
program, program_size,
|
program, program_size,
|
||||||
&prog_data, sizeof(prog_data),
|
&prog_data, sizeof(prog_data),
|
||||||
|
@ -257,7 +257,7 @@ brw_wm_debug_recompile(struct brw_context *brw,
|
||||||
|
|
||||||
for (unsigned int i = 0; i < brw->cache.size; i++) {
|
for (unsigned int i = 0; i < brw->cache.size; i++) {
|
||||||
for (c = brw->cache.items[i]; c; c = c->next) {
|
for (c = brw->cache.items[i]; c; c = c->next) {
|
||||||
if (c->cache_id == BRW_WM_PROG) {
|
if (c->cache_id == BRW_CACHE_FS_PROG) {
|
||||||
old_key = c->key;
|
old_key = c->key;
|
||||||
|
|
||||||
if (old_key->program_string_id == key->program_string_id)
|
if (old_key->program_string_id == key->program_string_id)
|
||||||
|
@ -573,7 +573,7 @@ brw_upload_wm_prog(struct brw_context *brw)
|
||||||
|
|
||||||
brw_wm_populate_key(brw, &key);
|
brw_wm_populate_key(brw, &key);
|
||||||
|
|
||||||
if (!brw_search_cache(&brw->cache, BRW_WM_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 = do_wm_prog(brw, ctx->_Shader->_CurrentFragmentProgram, fp,
|
||||||
|
|
Loading…
Reference in New Issue