aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/state_tracker
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-04-10 11:33:12 +0200
committermarha <marha@users.sourceforge.net>2012-04-10 11:33:12 +0200
commitd79e641dea89c0d5d651b11971c4c9e14df34629 (patch)
tree59d636ef9c4c21906ea28ac719589f25b9794d0a /mesalib/src/mesa/state_tracker
parentbf59764a4685c4bef029eddfa75d7496d2a91ae0 (diff)
parentc6f80401dc533b04341afe8d596960d1bc25efce (diff)
downloadvcxsrv-d79e641dea89c0d5d651b11971c4c9e14df34629.tar.gz
vcxsrv-d79e641dea89c0d5d651b11971c4c9e14df34629.tar.bz2
vcxsrv-d79e641dea89c0d5d651b11971c4c9e14df34629.zip
Merge remote-tracking branch 'origin/released'
Conflicts: xorg-server/os/log.c
Diffstat (limited to 'mesalib/src/mesa/state_tracker')
-rw-r--r--mesalib/src/mesa/state_tracker/st_cb_queryobj.c4
-rw-r--r--mesalib/src/mesa/state_tracker/st_draw.c20
-rw-r--r--mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp6
3 files changed, 25 insertions, 5 deletions
diff --git a/mesalib/src/mesa/state_tracker/st_cb_queryobj.c b/mesalib/src/mesa/state_tracker/st_cb_queryobj.c
index 057499615..b6a236e8d 100644
--- a/mesalib/src/mesa/state_tracker/st_cb_queryobj.c
+++ b/mesalib/src/mesa/state_tracker/st_cb_queryobj.c
@@ -150,7 +150,7 @@ st_WaitQuery(struct gl_context *ctx, struct gl_query_object *q)
!pipe->get_query_result(pipe,
stq->pq,
TRUE,
- &q->Result))
+ (void*)&q->Result))
{
/* nothing */
}
@@ -165,7 +165,7 @@ st_CheckQuery(struct gl_context *ctx, struct gl_query_object *q)
struct pipe_context *pipe = st_context(ctx)->pipe;
struct st_query_object *stq = st_query_object(q);
assert(!q->Ready); /* we should not get called if Ready is TRUE */
- q->Ready = pipe->get_query_result(pipe, stq->pq, FALSE, &q->Result);
+ q->Ready = pipe->get_query_result(pipe, stq->pq, FALSE, (void*)&q->Result);
}
diff --git a/mesalib/src/mesa/state_tracker/st_draw.c b/mesalib/src/mesa/state_tracker/st_draw.c
index eb187519f..0a35ab2be 100644
--- a/mesalib/src/mesa/state_tracker/st_draw.c
+++ b/mesalib/src/mesa/state_tracker/st_draw.c
@@ -979,6 +979,7 @@ st_draw_vbo(struct gl_context *ctx,
struct pipe_index_buffer ibuffer;
struct pipe_draw_info info;
unsigned i, num_instances = 1;
+ unsigned max_index_plus_base;
GLboolean new_array =
st->dirty.st &&
(st->dirty.mesa & (_NEW_ARRAY | _NEW_PROGRAM | _NEW_BUFFER_OBJECT)) != 0;
@@ -987,6 +988,8 @@ st_draw_vbo(struct gl_context *ctx,
assert(ctx->NewState == 0x0);
if (ib) {
+ int max_base_vertex = 0;
+
/* Gallium probably doesn't want this in some cases. */
if (!index_bounds_valid)
if (!all_varyings_in_vbos(arrays))
@@ -995,7 +998,16 @@ st_draw_vbo(struct gl_context *ctx,
for (i = 0; i < nr_prims; i++) {
num_instances = MAX2(num_instances, prims[i].num_instances);
+ max_base_vertex = MAX2(max_base_vertex, prims[i].basevertex);
}
+
+ /* Compute the sum of max_index and max_base_vertex. That's the value
+ * we need to use when creating buffers.
+ */
+ if (max_index == ~0)
+ max_index_plus_base = max_index;
+ else
+ max_index_plus_base = max_index + max_base_vertex;
}
else {
/* Get min/max index for non-indexed drawing. */
@@ -1007,6 +1019,9 @@ st_draw_vbo(struct gl_context *ctx,
max_index = MAX2(max_index, prims[i].start + prims[i].count - 1);
num_instances = MAX2(num_instances, prims[i].num_instances);
}
+
+ /* The base vertex offset only applies to indexed drawing */
+ max_index_plus_base = max_index;
}
/* Validate state. */
@@ -1023,7 +1038,8 @@ st_draw_vbo(struct gl_context *ctx,
st_validate_state(st);
if (new_array) {
- if (!st_validate_varrays(ctx, arrays, max_index, num_instances)) {
+ if (!st_validate_varrays(ctx, arrays, max_index_plus_base,
+ num_instances)) {
/* probably out of memory, no-op the draw call */
return;
}
@@ -1047,7 +1063,7 @@ st_draw_vbo(struct gl_context *ctx,
unsigned element_size = st->user_attrib[i].element_size;
unsigned stride = st->user_attrib[i].stride;
unsigned min_offset = min_index * stride;
- unsigned max_offset = max_index * stride + element_size;
+ unsigned max_offset = max_index_plus_base * stride + element_size;
assert(max_offset > min_offset);
diff --git a/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index b0227855c..ae8533e18 100644
--- a/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -2439,7 +2439,7 @@ void
glsl_to_tgsi_visitor::visit(ir_call *ir)
{
glsl_to_tgsi_instruction *call_inst;
- ir_function_signature *sig = ir->get_callee();
+ ir_function_signature *sig = ir->callee;
function_entry *entry = get_function_signature(sig);
int i;
@@ -2815,6 +2815,10 @@ glsl_to_tgsi_visitor::glsl_to_tgsi_visitor()
indirect_addr_temps = false;
indirect_addr_consts = false;
mem_ctx = ralloc_context(NULL);
+ ctx = NULL;
+ prog = NULL;
+ shader_program = NULL;
+ options = NULL;
}
glsl_to_tgsi_visitor::~glsl_to_tgsi_visitor()