draw/llvm: Remove unused gs_constants from jit_context
authorZack Rusin <zackr@vmware.com>
Thu, 14 Mar 2013 00:13:21 +0000 (17:13 -0700)
committerZack Rusin <zackr@vmware.com>
Wed, 27 Mar 2013 10:53:01 +0000 (03:53 -0700)
The member was never used and we'll need to handle it differently
because gs will also need samplers/textures setup.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
src/gallium/auxiliary/draw/draw_llvm.c
src/gallium/auxiliary/draw/draw_llvm.h
src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c

index 20c9b7981aea3ff4adfa91c56d6bb8ff49235859..602839d0d44a0bf6253fb045b40d574723f02573 100644 (file)
@@ -189,18 +189,17 @@ create_jit_context_type(struct gallivm_state *gallivm,
 {
    LLVMTargetDataRef target = gallivm->target;
    LLVMTypeRef float_type = LLVMFloatTypeInContext(gallivm->context);
-   LLVMTypeRef elem_types[6];
+   LLVMTypeRef elem_types[5];
    LLVMTypeRef context_type;
 
    elem_types[0] = LLVMArrayType(LLVMPointerType(float_type, 0), /* vs_constants */
                                  LP_MAX_TGSI_CONST_BUFFERS);
-   elem_types[1] = elem_types[0]; /* gs_constants */
-   elem_types[2] = LLVMPointerType(LLVMArrayType(LLVMArrayType(float_type, 4),
+   elem_types[1] = LLVMPointerType(LLVMArrayType(LLVMArrayType(float_type, 4),
                                                  DRAW_TOTAL_CLIP_PLANES), 0);
-   elem_types[3] = LLVMPointerType(float_type, 0); /* viewport */
-   elem_types[4] = LLVMArrayType(texture_type,
+   elem_types[2] = LLVMPointerType(float_type, 0); /* viewport */
+   elem_types[3] = LLVMArrayType(texture_type,
                                  PIPE_MAX_SHADER_SAMPLER_VIEWS); /* textures */
-   elem_types[5] = LLVMArrayType(sampler_type,
+   elem_types[4] = LLVMArrayType(sampler_type,
                                  PIPE_MAX_SAMPLERS); /* samplers */
    context_type = LLVMStructTypeInContext(gallivm->context, elem_types,
                                           Elements(elem_types), 0);
@@ -212,12 +211,10 @@ create_jit_context_type(struct gallivm_state *gallivm,
 
    LP_CHECK_MEMBER_OFFSET(struct draw_jit_context, vs_constants,
                           target, context_type, 0);
-   LP_CHECK_MEMBER_OFFSET(struct draw_jit_context, gs_constants,
-                          target, context_type, 1);
    LP_CHECK_MEMBER_OFFSET(struct draw_jit_context, planes,
-                          target, context_type, 2);
+                          target, context_type, 1);
    LP_CHECK_MEMBER_OFFSET(struct draw_jit_context, viewport,
-                          target, context_type, 3);
+                          target, context_type, 2);
    LP_CHECK_MEMBER_OFFSET(struct draw_jit_context, textures,
                           target, context_type,
                           DRAW_JIT_CTX_TEXTURES);
index c9f125b1f63201ee8ad688e35887654988998ede..c03c69e57b341ce4fce3647287f9d473f881c329 100644 (file)
@@ -106,9 +106,6 @@ enum {
    DRAW_JIT_VERTEX_DATA
 };
 
-#define DRAW_JIT_CTX_TEXTURES 4
-#define DRAW_JIT_CTX_SAMPLERS 5
-
 /**
  * This structure is passed directly to the generated vertex shader.
  *
@@ -123,7 +120,6 @@ enum {
 struct draw_jit_context
 {
    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;
 
@@ -135,17 +131,14 @@ struct draw_jit_context
 #define draw_jit_context_vs_constants(_gallivm, _ptr) \
    lp_build_struct_get_ptr(_gallivm, _ptr, 0, "vs_constants")
 
-#define draw_jit_context_gs_constants(_gallivm, _ptr) \
-   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")
+   lp_build_struct_get(_gallivm, _ptr, 1, "planes")
 
 #define draw_jit_context_viewport(_gallivm, _ptr) \
-   lp_build_struct_get(_gallivm, _ptr, 3, "viewport")
+   lp_build_struct_get(_gallivm, _ptr, 2, "viewport")
 
-#define DRAW_JIT_CTX_TEXTURES 4
-#define DRAW_JIT_CTX_SAMPLERS 5
+#define DRAW_JIT_CTX_TEXTURES 3
+#define DRAW_JIT_CTX_SAMPLERS 4
 
 #define draw_jit_context_textures(_gallivm, _ptr) \
    lp_build_struct_get_ptr(_gallivm, _ptr, DRAW_JIT_CTX_TEXTURES, "textures")
index 288b5242ae8769215c713e098d49c17dcbf9dafd..fab168c6d473be0c432e085cf97ed2bc11bcc840 100644 (file)
@@ -200,10 +200,6 @@ llvm_middle_end_bind_parameters(struct draw_pt_middle_end *middle)
       fpme->llvm->jit_context.vs_constants[i] = draw->pt.user.vs_constants[i];
    }
 
-   for (i = 0; i < Elements(fpme->llvm->jit_context.gs_constants); ++i) {
-      fpme->llvm->jit_context.gs_constants[i] = draw->pt.user.gs_constants[i];
-   }
-
    fpme->llvm->jit_context.planes =
       (float (*)[DRAW_TOTAL_CLIP_PLANES][4]) draw->pt.user.planes[0];