st/mesa: mark constant array of swizzles as static const
authorNils Wallménius <nils.wallmenius@gmail.com>
Thu, 22 Jan 2015 19:47:28 +0000 (20:47 +0100)
committerChris Forbes <chrisf@ijw.co.nz>
Tue, 3 Feb 2015 20:07:13 +0000 (09:07 +1300)
This saves about 0.5k in the text section for a gallium driver
on amd64.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
src/mesa/state_tracker/st_glsl_to_tgsi.cpp

index b84f39dd183edd451d7dca893b5e0d133ba75214..a9ea8c82abae7c610954f979021bd17b0a558b10 100644 (file)
@@ -486,7 +486,7 @@ fail_link(struct gl_shader_program *prog, const char *fmt, ...)
 static int
 swizzle_for_size(int size)
 {
-   int size_swizzles[4] = {
+   static const int size_swizzles[4] = {
       MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X),
       MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Y, SWIZZLE_Y),
       MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_Z),