i965: Make the brw_format_for_mesa_format table static const.
authorEric Anholt <eric@anholt.net>
Wed, 22 Jun 2011 00:38:20 +0000 (17:38 -0700)
committerEric Anholt <eric@anholt.net>
Fri, 24 Jun 2011 17:37:22 +0000 (10:37 -0700)
Once again, assuming the compiler is clever works out so poorly.  The
generated code initialized the structure on the stack, then did a
lookup into it.  This was a performance regression from
70c6cd39bd9396b0d3f9e84df41fd8bef1f26cc4.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/drivers/dri/i965/brw_wm_surface_state.c

index ac8005dc6c272f3b782dd3c34a054f4dc9103389..89fea9cc9521c8fd67cbbc7f4eae16b91cc4dd5e 100644 (file)
@@ -73,7 +73,7 @@ translate_tex_target(GLenum target)
 uint32_t
 brw_format_for_mesa_format(gl_format mesa_format)
 {
-   uint32_t table[MESA_FORMAT_COUNT] =
+   static const uint32_t table[MESA_FORMAT_COUNT] =
    {
       [MESA_FORMAT_L8] = BRW_SURFACEFORMAT_L8_UNORM,
       [MESA_FORMAT_I8] = BRW_SURFACEFORMAT_I8_UNORM,