From 1d35f77228ad540a551a8e09e062b764a6e31f5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Fonseca?= Date: Tue, 4 Dec 2012 14:52:44 +0000 Subject: gallivm,llvmpipe,draw: Support multiple constant buffers. Support 16 (defined in LP_MAX_TGSI_CONST_BUFFERS) as opposed to 32 (as defined by PIPE_MAX_CONSTANT_BUFFERS) because that would make the jit context become unnecessarily large. v2: Bump limit from 4 to 16 to cover ARB_uniform_buffer_object needs, per Dave Airlie. Reviewed-by: Brian Paul --- src/gallium/auxiliary/draw/draw_llvm.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/gallium/auxiliary/draw/draw_llvm.h') diff --git a/src/gallium/auxiliary/draw/draw_llvm.h b/src/gallium/auxiliary/draw/draw_llvm.h index d7a630e..bd11886 100644 --- a/src/gallium/auxiliary/draw/draw_llvm.h +++ b/src/gallium/auxiliary/draw/draw_llvm.h @@ -32,6 +32,7 @@ #include "draw/draw_vs.h" #include "gallivm/lp_bld_sample.h" +#include "gallivm/lp_bld_limits.h" #include "pipe/p_context.h" #include "util/u_simple_list.h" @@ -94,8 +95,8 @@ enum { */ struct draw_jit_context { - const float *vs_constants; - const float *gs_constants; + const float *vs_constants[LP_MAX_TGSI_CONST_BUFFERS]; + const float *gs_constants[LP_MAX_TGSI_CONST_BUFFERS]; float (*planes) [DRAW_TOTAL_CLIP_PLANES][4]; float *viewport; @@ -104,10 +105,10 @@ struct draw_jit_context #define draw_jit_context_vs_constants(_gallivm, _ptr) \ - lp_build_struct_get(_gallivm, _ptr, 0, "vs_constants") + lp_build_struct_get_ptr(_gallivm, _ptr, 0, "vs_constants") #define draw_jit_context_gs_constants(_gallivm, _ptr) \ - lp_build_struct_get(_gallivm, _ptr, 1, "gs_constants") + lp_build_struct_get_ptr(_gallivm, _ptr, 1, "gs_constants") #define draw_jit_context_planes(_gallivm, _ptr) \ lp_build_struct_get(_gallivm, _ptr, 2, "planes") -- cgit v1.1