brw_blorp_prog_data **prog_data) const
{
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),
&prog_offset, prog_data)) {
brw_blorp_blit_program prog(brw, &this->wm_prog_key,
INTEL_DEBUG & DEBUG_BLORP);
GLuint 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),
program, program_size,
&prog.prog_data, sizeof(prog.prog_data),
}
brw_upload_cache(&brw->cache,
- BRW_CLIP_PROG,
+ BRW_CACHE_CLIP_PROG,
&c.key, sizeof(c.key),
program, program_size,
&c.prog_data, sizeof(c.prog_data),
}
}
- if (!brw_search_cache(&brw->cache, BRW_CLIP_PROG,
+ if (!brw_search_cache(&brw->cache, BRW_CACHE_CLIP_PROG,
&key, sizeof(key),
&brw->clip.prog_offset, &brw->clip.prog_data)) {
compile_clip_prog( brw, &key );
#define SHADER_TIME_STRIDE 64
enum brw_cache_id {
- BRW_WM_PROG,
- BRW_BLORP_BLIT_PROG,
- BRW_SF_PROG,
- BRW_VS_PROG,
- BRW_FF_GS_PROG,
- BRW_GS_PROG,
- BRW_CLIP_PROG,
+ BRW_CACHE_FS_PROG,
+ BRW_CACHE_BLORP_BLIT_PROG,
+ BRW_CACHE_SF_PROG,
+ BRW_CACHE_VS_PROG,
+ BRW_CACHE_FF_GS_PROG,
+ BRW_CACHE_GS_PROG,
+ BRW_CACHE_CLIP_PROG,
BRW_MAX_CACHE
};
/* Flags for brw->state.cache.
*/
-#define CACHE_NEW_WM_PROG (1<<BRW_WM_PROG)
-#define CACHE_NEW_BLORP_BLIT_PROG (1<<BRW_BLORP_BLIT_PROG)
-#define CACHE_NEW_SF_PROG (1<<BRW_SF_PROG)
-#define CACHE_NEW_VS_PROG (1<<BRW_VS_PROG)
-#define CACHE_NEW_FF_GS_PROG (1<<BRW_FF_GS_PROG)
-#define CACHE_NEW_GS_PROG (1<<BRW_GS_PROG)
-#define CACHE_NEW_CLIP_PROG (1<<BRW_CLIP_PROG)
+#define CACHE_NEW_WM_PROG (1 << BRW_CACHE_FS_PROG)
+#define CACHE_NEW_BLORP_BLIT_PROG (1 << BRW_CACHE_BLORP_BLIT_PROG)
+#define CACHE_NEW_SF_PROG (1 << BRW_CACHE_SF_PROG)
+#define CACHE_NEW_VS_PROG (1 << BRW_CACHE_VS_PROG)
+#define CACHE_NEW_FF_GS_PROG (1 << BRW_CACHE_FF_GS_PROG)
+#define CACHE_NEW_GS_PROG (1 << BRW_CACHE_GS_PROG)
+#define CACHE_NEW_CLIP_PROG (1 << BRW_CACHE_CLIP_PROG)
struct brw_vertex_buffer {
/** Buffer object containing the uploaded vertex data */
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),
program, program_size,
&c.prog_data, sizeof(c.prog_data),
}
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),
&brw->ff_gs.prog_offset, &brw->ff_gs.prog_data)) {
compile_ff_gs_prog( brw, &key );
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),
program, program_size,
&c.prog_data, sizeof(c.prog_data),
/* BRW_NEW_VUE_MAP_VS */
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),
&stage_state->prog_offset, &brw->gs.prog_data)) {
bool success =
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),
program, program_size,
&c.prog_data, sizeof(c.prog_data),
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),
&brw->sf.prog_offset, &brw->sf.prog_data)) {
compile_sf_prog( brw, &key );
if (brw->has_llc)
drm_intel_gem_bo_map_unsynchronized(cache->bo);
- cache->aux_compare[BRW_VS_PROG] = brw_vs_prog_data_compare;
- cache->aux_compare[BRW_GS_PROG] = brw_gs_prog_data_compare;
- cache->aux_compare[BRW_WM_PROG] = brw_wm_prog_data_compare;
- cache->aux_free[BRW_VS_PROG] = brw_stage_prog_data_free;
- cache->aux_free[BRW_GS_PROG] = brw_stage_prog_data_free;
- cache->aux_free[BRW_WM_PROG] = brw_stage_prog_data_free;
+ cache->aux_compare[BRW_CACHE_VS_PROG] = brw_vs_prog_data_compare;
+ cache->aux_compare[BRW_CACHE_GS_PROG] = brw_gs_prog_data_compare;
+ cache->aux_compare[BRW_CACHE_FS_PROG] = brw_wm_prog_data_compare;
+ cache->aux_free[BRW_CACHE_VS_PROG] = brw_stage_prog_data_free;
+ cache->aux_free[BRW_CACHE_GS_PROG] = brw_stage_prog_data_free;
+ cache->aux_free[BRW_CACHE_FS_PROG] = brw_stage_prog_data_free;
}
static void
const char *name;
switch (item->cache_id) {
- case BRW_VS_PROG:
+ case BRW_CACHE_VS_PROG:
name = "VS kernel";
break;
- case BRW_FF_GS_PROG:
+ case BRW_CACHE_FF_GS_PROG:
name = "Fixed-function GS kernel";
break;
- case BRW_GS_PROG:
+ case BRW_CACHE_GS_PROG:
name = "GS kernel";
break;
- case BRW_CLIP_PROG:
+ case BRW_CACHE_CLIP_PROG:
name = "CLIP kernel";
break;
- case BRW_SF_PROG:
+ case BRW_CACHE_SF_PROG:
name = "SF kernel";
break;
- case BRW_WM_PROG:
- name = "WM kernel";
+ case BRW_CACHE_FS_PROG:
+ name = "FS kernel";
break;
default:
name = "unknown";
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),
program, program_size,
&prog_data, sizeof(prog_data),
for (unsigned int i = 0; i < brw->cache.size; i++) {
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;
if (old_key->base.program_string_id == key->base.program_string_id)
}
}
- if (!brw_search_cache(&brw->cache, BRW_VS_PROG,
+ if (!brw_search_cache(&brw->cache, BRW_CACHE_VS_PROG,
&key, sizeof(key),
&brw->vs.base.prog_offset, &brw->vs.prog_data)) {
bool success =
if (unlikely(INTEL_DEBUG & DEBUG_WM))
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),
program, program_size,
&prog_data, sizeof(prog_data),
for (unsigned int i = 0; i < brw->cache.size; i++) {
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;
if (old_key->program_string_id == key->program_string_id)
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),
&brw->wm.base.prog_offset, &brw->wm.prog_data)) {
bool success = do_wm_prog(brw, ctx->_Shader->_CurrentFragmentProgram, fp,