[Mesa-dev] [PATCH 07/10] i965: Add _CACHE_ in brw_cache_id enum names.

Matt Turner mattst88 at gmail.com
Tue Nov 25 14:29:53 PST 2014


On Tue, Nov 25, 2014 at 4:43 AM, Kenneth Graunke <kenneth at whitecape.org> wrote:
> 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 at whitecape.org>
> ---
>  src/mesa/drivers/dri/i965/brw_blorp_blit.cpp |  4 ++--
>  src/mesa/drivers/dri/i965/brw_clip.c         |  4 ++--
>  src/mesa/drivers/dri/i965/brw_context.h      | 28 ++++++++++++++--------------
>  src/mesa/drivers/dri/i965/brw_ff_gs.c        |  4 ++--
>  src/mesa/drivers/dri/i965/brw_gs.c           |  4 ++--
>  src/mesa/drivers/dri/i965/brw_sf.c           |  4 ++--
>  src/mesa/drivers/dri/i965/brw_state_cache.c  | 12 ++++++------
>  src/mesa/drivers/dri/i965/brw_state_dump.c   | 14 +++++++-------
>  src/mesa/drivers/dri/i965/brw_vs.c           |  6 +++---
>  src/mesa/drivers/dri/i965/brw_wm.c           |  6 +++---
>  10 files changed, 43 insertions(+), 43 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
> index 844f5e4..a103af0 100644
> --- a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
> @@ -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),
> diff --git a/src/mesa/drivers/dri/i965/brw_clip.c b/src/mesa/drivers/dri/i965/brw_clip.c
> index debeee5..3fef38c 100644
> --- a/src/mesa/drivers/dri/i965/brw_clip.c
> +++ b/src/mesa/drivers/dri/i965/brw_clip.c
> @@ -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 );
> diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h
> index fac22dc..c4e96de 100644
> --- a/src/mesa/drivers/dri/i965/brw_context.h
> +++ b/src/mesa/drivers/dri/i965/brw_context.h
> @@ -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)

Would it be useful to go ahead and make this an enum at the same time?
(Maybe not even change the type of state.cache yet)


More information about the mesa-dev mailing list