summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/draw/draw_llvm.h
diff options
context:
space:
mode:
authorZack Rusin <zackr@vmware.com>2013-03-29 19:33:34 -0700
committerZack Rusin <zackr@vmware.com>2013-04-03 10:16:25 -0700
commitb16ae0f792ed1980e86c45f9e3d203412b5a80d3 (patch)
tree451f975bc618dfdee561daea74294b78d83888c1 /src/gallium/auxiliary/draw/draw_llvm.h
parent49b7d933f8608df9d20606f022a032785e243ab9 (diff)
downloadexternal_mesa3d-b16ae0f792ed1980e86c45f9e3d203412b5a80d3.zip
external_mesa3d-b16ae0f792ed1980e86c45f9e3d203412b5a80d3.tar.gz
external_mesa3d-b16ae0f792ed1980e86c45f9e3d203412b5a80d3.tar.bz2
draw/llvm: use an enum instead of magic numbers
I think this was there before and got accidently removed during a merge. Same code as for the GS context, which is also using an enum instead of hardcoded numbers. Signed-off-by: Zack Rusin <zackr@vmware.com> Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: José Fonseca <jfonseca@vmware.com>
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_llvm.h')
-rw-r--r--src/gallium/auxiliary/draw/draw_llvm.h17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/gallium/auxiliary/draw/draw_llvm.h b/src/gallium/auxiliary/draw/draw_llvm.h
index 8df02a2..5909fc1 100644
--- a/src/gallium/auxiliary/draw/draw_llvm.h
+++ b/src/gallium/auxiliary/draw/draw_llvm.h
@@ -130,18 +130,23 @@ struct draw_jit_context
struct draw_jit_sampler samplers[PIPE_MAX_SAMPLERS];
};
+enum {
+ DRAW_JIT_CTX_CONSTANTS = 0,
+ DRAW_JIT_CTX_PLANES = 1,
+ DRAW_JIT_CTX_VIEWPORT = 2,
+ DRAW_JIT_CTX_TEXTURES = 3,
+ DRAW_JIT_CTX_SAMPLERS = 4,
+ DRAW_JIT_CTX_NUM_FIELDS
+};
#define draw_jit_context_vs_constants(_gallivm, _ptr) \
- lp_build_struct_get_ptr(_gallivm, _ptr, 0, "vs_constants")
+ lp_build_struct_get_ptr(_gallivm, _ptr, DRAW_JIT_CTX_CONSTANTS, "vs_constants")
#define draw_jit_context_planes(_gallivm, _ptr) \
- lp_build_struct_get(_gallivm, _ptr, 1, "planes")
+ lp_build_struct_get(_gallivm, _ptr, DRAW_JIT_CTX_PLANES, "planes")
#define draw_jit_context_viewport(_gallivm, _ptr) \
- lp_build_struct_get(_gallivm, _ptr, 2, "viewport")
-
-#define DRAW_JIT_CTX_TEXTURES 3
-#define DRAW_JIT_CTX_SAMPLERS 4
+ lp_build_struct_get(_gallivm, _ptr, DRAW_JIT_CTX_VIEWPORT, "viewport")
#define draw_jit_context_textures(_gallivm, _ptr) \
lp_build_struct_get_ptr(_gallivm, _ptr, DRAW_JIT_CTX_TEXTURES, "textures")