i965: Add _CACHE_ in brw_cache_id enum names.
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 26 Sep 2014 18:38:06 +0000 (11:38 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Sat, 29 Nov 2014 10:18:47 +0000 (02:18 -0800)
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>
src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
src/mesa/drivers/dri/i965/brw_clip.c
src/mesa/drivers/dri/i965/brw_context.h
src/mesa/drivers/dri/i965/brw_ff_gs.c
src/mesa/drivers/dri/i965/brw_gs.c
src/mesa/drivers/dri/i965/brw_sf.c
src/mesa/drivers/dri/i965/brw_state_cache.c
src/mesa/drivers/dri/i965/brw_state_dump.c
src/mesa/drivers/dri/i965/brw_vs.c
src/mesa/drivers/dri/i965/brw_wm.c

index 844f5e43029baf5551d2b40228aecd451eb84928..a103af0878b91ad4029b16b668d22ac5528ff46f 100644 (file)
@@ -2119,14 +2119,14 @@ brw_blorp_blit_params::get_wm_prog(struct brw_context *brw,
                                    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),
index debeee5ccc91fab9baa63fd150e2b28a722e1ba1..3fef38ccab9173ad081540acc780db188f5235b4 100644 (file)
@@ -122,7 +122,7 @@ static void compile_clip_prog( struct brw_context *brw,
    }
 
    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),
@@ -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),
                         &brw->clip.prog_offset, &brw->clip.prog_data)) {
       compile_clip_prog( brw, &key );
index fac22dc99a91d3593c96c63c5dc4c56b040eec55..c4e96dee3277386342a8dd9c6b0c37aa0c95ac5e 100644 (file)
@@ -693,13 +693,13 @@ struct brw_gs_prog_data
 #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
 };
@@ -777,13 +777,13 @@ enum shader_time_shader_type {
 
 /* 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 */
index 377e1faa24d7b38754216f15c08a31d3c383b890..d21243836b48f341c7da6445dacabf86912d79f3 100644 (file)
@@ -139,7 +139,7 @@ static void compile_ff_gs_prog(struct brw_context *brw,
       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),
@@ -235,7 +235,7 @@ brw_upload_ff_gs_prog(struct brw_context *brw)
    }
 
    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 );
index 4b61646acfa4ab1d50dc08f408d6d206bef3e537..b2ecf8fd0c560136f197f6e8d5f4263a2e74393f 100644 (file)
@@ -282,7 +282,7 @@ do_gs_prog(struct brw_context *brw,
                          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),
@@ -343,7 +343,7 @@ brw_upload_gs_prog(struct brw_context *brw)
    /* 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 =
index 625c4a5e1de957c6ba94e76575f491537a5931eb..a41a4ad4a4347f38683fae8623cbde68777bbb3f 100644 (file)
@@ -123,7 +123,7 @@ static void compile_sf_prog( struct brw_context *brw,
       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),
@@ -207,7 +207,7 @@ brw_upload_sf_prog(struct brw_context *brw)
       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 );
index cf42ada7495ad321c6e792eb4e27d6d760a2f76b..29b1597168e31b3c5b1b2daf1ea4d4230f91bce9 100644 (file)
@@ -360,12 +360,12 @@ brw_init_caches(struct brw_context *brw)
    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
index 611998f12969243fe56a59692d08d23e548b2f1e..8b32810afe935bc013fc618e5024adae86033f44 100644 (file)
@@ -472,23 +472,23 @@ dump_prog_cache(struct brw_context *brw)
         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";
index 1bfea3d88e6d1d8fa2506ac095fcb801da3ac360..7a3b4d26384d95c105309fb994fef8066d582aac 100644 (file)
@@ -312,7 +312,7 @@ do_vs_prog(struct brw_context *brw,
                          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),
@@ -345,7 +345,7 @@ brw_vs_debug_recompile(struct brw_context *brw,
 
    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)
@@ -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),
                         &brw->vs.base.prog_offset, &brw->vs.prog_data)) {
       bool success =
index 29d35ccf9299e7ad547d3a49e38e526fd9dba70e..01838522799eb96232213238a087a2ed28de8811 100644 (file)
@@ -199,7 +199,7 @@ bool do_wm_prog(struct brw_context *brw,
    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),
@@ -257,7 +257,7 @@ brw_wm_debug_recompile(struct brw_context *brw,
 
    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)
@@ -573,7 +573,7 @@ brw_upload_wm_prog(struct brw_context *brw)
 
    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,