summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorJosé Fonseca <[email protected]>2014-11-16 11:33:21 +0000
committerJosé Fonseca <[email protected]>2014-11-16 11:33:21 +0000
commitaafbebe8ab64012fe625037c7773fa779b6f442f (patch)
tree0bfb19c4c49d2b87272f3fd74080612de4706b84 /src/gallium
parent2a3e140ff461eb092a3b157d404dccab4f2a7aba (diff)
draw: Make it more clear that *_jit_context points to pipe_viewport_state structures.
No change in behavior.
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/auxiliary/draw/draw_llvm.c10
-rw-r--r--src/gallium/auxiliary/draw/draw_llvm.h12
-rw-r--r--src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c4
3 files changed, 13 insertions, 13 deletions
diff --git a/src/gallium/auxiliary/draw/draw_llvm.c b/src/gallium/auxiliary/draw/draw_llvm.c
index 0acb0227b2a..3a1b0579648 100644
--- a/src/gallium/auxiliary/draw/draw_llvm.c
+++ b/src/gallium/auxiliary/draw/draw_llvm.c
@@ -225,7 +225,7 @@ create_jit_context_type(struct gallivm_state *gallivm,
LP_MAX_TGSI_CONST_BUFFERS);
elem_types[2] = LLVMPointerType(LLVMArrayType(LLVMArrayType(float_type, 4),
DRAW_TOTAL_CLIP_PLANES), 0);
- elem_types[3] = LLVMPointerType(float_type, 0); /* viewport */
+ elem_types[3] = LLVMPointerType(float_type, 0); /* viewports */
elem_types[4] = LLVMArrayType(texture_type,
PIPE_MAX_SHADER_SAMPLER_VIEWS); /* textures */
elem_types[5] = LLVMArrayType(sampler_type,
@@ -238,7 +238,7 @@ create_jit_context_type(struct gallivm_state *gallivm,
target, context_type, DRAW_JIT_CTX_NUM_CONSTANTS);
LP_CHECK_MEMBER_OFFSET(struct draw_jit_context, planes,
target, context_type, DRAW_JIT_CTX_PLANES);
- LP_CHECK_MEMBER_OFFSET(struct draw_jit_context, viewport,
+ LP_CHECK_MEMBER_OFFSET(struct draw_jit_context, viewports,
target, context_type, DRAW_JIT_CTX_VIEWPORT);
LP_CHECK_MEMBER_OFFSET(struct draw_jit_context, textures,
target, context_type,
@@ -274,7 +274,7 @@ create_gs_jit_context_type(struct gallivm_state *gallivm,
LP_MAX_TGSI_CONST_BUFFERS);
elem_types[2] = LLVMPointerType(LLVMArrayType(LLVMArrayType(float_type, 4),
DRAW_TOTAL_CLIP_PLANES), 0);
- elem_types[3] = LLVMPointerType(float_type, 0); /* viewport */
+ elem_types[3] = LLVMPointerType(float_type, 0); /* viewports */
elem_types[4] = LLVMArrayType(texture_type,
PIPE_MAX_SHADER_SAMPLER_VIEWS); /* textures */
@@ -296,7 +296,7 @@ create_gs_jit_context_type(struct gallivm_state *gallivm,
target, context_type, DRAW_GS_JIT_CTX_NUM_CONSTANTS);
LP_CHECK_MEMBER_OFFSET(struct draw_gs_jit_context, planes,
target, context_type, DRAW_GS_JIT_CTX_PLANES);
- LP_CHECK_MEMBER_OFFSET(struct draw_gs_jit_context, viewport,
+ LP_CHECK_MEMBER_OFFSET(struct draw_gs_jit_context, viewports,
target, context_type, DRAW_GS_JIT_CTX_VIEWPORT);
LP_CHECK_MEMBER_OFFSET(struct draw_gs_jit_context, textures,
target, context_type,
@@ -1080,7 +1080,7 @@ generate_viewport(struct draw_llvm_variant *variant,
LLVMTypeRef vs_type_llvm = lp_build_vec_type(gallivm, vs_type);
LLVMValueRef out3 = LLVMBuildLoad(builder, outputs[pos][3], ""); /*w0 w1 .. wn*/
LLVMValueRef const1 = lp_build_const_vec(gallivm, f32_type, 1.0); /*1.0 1.0 1.0 1.0*/
- LLVMValueRef vp_ptr = draw_jit_context_viewport(gallivm, context_ptr);
+ LLVMValueRef vp_ptr = draw_jit_context_viewports(gallivm, context_ptr);
/* We treat pipe_viewport_state as a float array */
const int scale_index_offset = offsetof(struct pipe_viewport_state, scale) / sizeof(float);
diff --git a/src/gallium/auxiliary/draw/draw_llvm.h b/src/gallium/auxiliary/draw/draw_llvm.h
index 54a7da2d02c..e7344343d73 100644
--- a/src/gallium/auxiliary/draw/draw_llvm.h
+++ b/src/gallium/auxiliary/draw/draw_llvm.h
@@ -125,7 +125,7 @@ struct draw_jit_context
const float *vs_constants[LP_MAX_TGSI_CONST_BUFFERS];
int num_vs_constants[LP_MAX_TGSI_CONST_BUFFERS];
float (*planes) [DRAW_TOTAL_CLIP_PLANES][4];
- float *viewport;
+ struct pipe_viewport_state *viewports;
struct draw_jit_texture textures[PIPE_MAX_SHADER_SAMPLER_VIEWS];
struct draw_jit_sampler samplers[PIPE_MAX_SAMPLERS];
@@ -150,8 +150,8 @@ enum {
#define draw_jit_context_planes(_gallivm, _ptr) \
lp_build_struct_get(_gallivm, _ptr, DRAW_JIT_CTX_PLANES, "planes")
-#define draw_jit_context_viewport(_gallivm, _ptr) \
- lp_build_struct_get(_gallivm, _ptr, DRAW_JIT_CTX_VIEWPORT, "viewport")
+#define draw_jit_context_viewports(_gallivm, _ptr) \
+ lp_build_struct_get(_gallivm, _ptr, DRAW_JIT_CTX_VIEWPORT, "viewports")
#define draw_jit_context_textures(_gallivm, _ptr) \
lp_build_struct_get_ptr(_gallivm, _ptr, DRAW_JIT_CTX_TEXTURES, "textures")
@@ -207,7 +207,7 @@ struct draw_gs_jit_context
const float *constants[LP_MAX_TGSI_CONST_BUFFERS];
int num_constants[LP_MAX_TGSI_CONST_BUFFERS];
float (*planes) [DRAW_TOTAL_CLIP_PLANES][4];
- float *viewport;
+ struct pipe_viewport_state *viewports;
/* There two need to be exactly at DRAW_JIT_CTX_TEXTURES and
* DRAW_JIT_CTX_SAMPLERS positions in the struct */
@@ -245,8 +245,8 @@ enum {
#define draw_gs_jit_context_planes(_gallivm, _ptr) \
lp_build_struct_get(_gallivm, _ptr, DRAW_GS_JIT_CTX_PLANES, "planes")
-#define draw_gs_jit_context_viewport(_gallivm, _ptr) \
- lp_build_struct_get(_gallivm, _ptr, DRAW_GS_JIT_CTX_VIEWPORT, "viewport")
+#define draw_gs_jit_context_viewports(_gallivm, _ptr) \
+ lp_build_struct_get(_gallivm, _ptr, DRAW_GS_JIT_CTX_VIEWPORT, "viewports")
#define draw_gs_jit_context_textures(_gallivm, _ptr) \
lp_build_struct_get_ptr(_gallivm, _ptr, DRAW_GS_JIT_CTX_TEXTURES, "textures")
diff --git a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c
index 54dc47aa07d..49341ffd9fd 100644
--- a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c
+++ b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c
@@ -294,8 +294,8 @@ llvm_middle_end_bind_parameters(struct draw_pt_middle_end *middle)
fpme->llvm->gs_jit_context.planes =
(float (*)[DRAW_TOTAL_CLIP_PLANES][4]) draw->pt.user.planes[0];
- fpme->llvm->jit_context.viewport = (float *) draw->viewports[0].scale;
- fpme->llvm->gs_jit_context.viewport = (float *) draw->viewports[0].scale;
+ fpme->llvm->jit_context.viewports = draw->viewports;
+ fpme->llvm->gs_jit_context.viewports = draw->viewports;
}