diff options
author | Zack Rusin <[email protected]> | 2013-03-29 19:33:34 -0700 |
---|---|---|
committer | Zack Rusin <[email protected]> | 2013-04-03 10:16:25 -0700 |
commit | b16ae0f792ed1980e86c45f9e3d203412b5a80d3 (patch) | |
tree | 451f975bc618dfdee561daea74294b78d83888c1 /src/gallium/auxiliary/draw/draw_llvm.c | |
parent | 49b7d933f8608df9d20606f022a032785e243ab9 (diff) |
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 <[email protected]>
Reviewed-by: Brian Paul <[email protected]>
Reviewed-by: José Fonseca <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_llvm.c')
-rw-r--r-- | src/gallium/auxiliary/draw/draw_llvm.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gallium/auxiliary/draw/draw_llvm.c b/src/gallium/auxiliary/draw/draw_llvm.c index d0199bbc92a..5100ce0039c 100644 --- a/src/gallium/auxiliary/draw/draw_llvm.c +++ b/src/gallium/auxiliary/draw/draw_llvm.c @@ -203,7 +203,7 @@ create_jit_context_type(struct gallivm_state *gallivm, { LLVMTargetDataRef target = gallivm->target; LLVMTypeRef float_type = LLVMFloatTypeInContext(gallivm->context); - LLVMTypeRef elem_types[5]; + LLVMTypeRef elem_types[DRAW_JIT_CTX_NUM_FIELDS]; LLVMTypeRef context_type; elem_types[0] = LLVMArrayType(LLVMPointerType(float_type, 0), /* vs_constants */ @@ -224,11 +224,11 @@ create_jit_context_type(struct gallivm_state *gallivm, #endif LP_CHECK_MEMBER_OFFSET(struct draw_jit_context, vs_constants, - target, context_type, 0); + target, context_type, DRAW_JIT_CTX_CONSTANTS); LP_CHECK_MEMBER_OFFSET(struct draw_jit_context, planes, - target, context_type, 1); + target, context_type, DRAW_JIT_CTX_PLANES); LP_CHECK_MEMBER_OFFSET(struct draw_jit_context, viewport, - target, context_type, 2); + target, context_type, DRAW_JIT_CTX_VIEWPORT); LP_CHECK_MEMBER_OFFSET(struct draw_jit_context, textures, target, context_type, DRAW_JIT_CTX_TEXTURES); |