summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r--src/mesa/state_tracker/st_draw.c4
-rw-r--r--src/mesa/state_tracker/st_gen_mipmap.c3
-rw-r--r--src/mesa/state_tracker/st_program.c2
3 files changed, 7 insertions, 2 deletions
diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c
index e13ae57a0e..d297b9bc06 100644
--- a/src/mesa/state_tracker/st_draw.c
+++ b/src/mesa/state_tracker/st_draw.c
@@ -381,7 +381,7 @@ setup_interleaved_attribs(GLcontext *ctx,
{
struct pipe_context *pipe = ctx->st->pipe;
GLuint attr;
- const GLubyte *offset0;
+ const GLubyte *offset0 = NULL;
for (attr = 0; attr < vp->num_inputs; attr++) {
const GLuint mesaAttr = vp->index_to_input[attr];
@@ -560,7 +560,7 @@ st_draw_vbo(GLcontext *ctx,
GLuint attr;
struct pipe_vertex_element velements[PIPE_MAX_ATTRIBS];
unsigned num_vbuffers, num_velements;
- GLboolean userSpace;
+ GLboolean userSpace = GL_FALSE;
/* Gallium probably doesn't want this in some cases. */
if (!index_bounds_valid)
diff --git a/src/mesa/state_tracker/st_gen_mipmap.c b/src/mesa/state_tracker/st_gen_mipmap.c
index 5a433dd7b9..2c283d464a 100644
--- a/src/mesa/state_tracker/st_gen_mipmap.c
+++ b/src/mesa/state_tracker/st_gen_mipmap.c
@@ -225,6 +225,9 @@ st_generate_mipmap(GLcontext *ctx, GLenum target,
/* find expected last mipmap level */
lastLevel = compute_num_levels(ctx, texObj, target) - 1;
+ if (lastLevel == 0)
+ return;
+
if (pt->last_level < lastLevel) {
/* The current gallium texture doesn't have space for all the
* mipmap levels we need to generate. So allocate a new texture.
diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c
index 5c81a033f9..d91ed6806d 100644
--- a/src/mesa/state_tracker/st_program.c
+++ b/src/mesa/state_tracker/st_program.c
@@ -102,6 +102,8 @@ st_prepare_vertex_program(struct st_context *st,
if (stvp->Base.IsPositionInvariant)
_mesa_insert_mvp_code(st->ctx, &stvp->Base);
+ assert(stvp->Base.Base.NumInstructions > 1);
+
/*
* Determine number of inputs, the mappings between VERT_ATTRIB_x
* and TGSI generic input indexes, plus input attrib semantic info.