From 325f045c04121b989bddfca02711e3d03f7f9c3f Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Fri, 18 Dec 2009 18:39:44 +0000 Subject: st/mesa: move assert on nr vs insns until after pos_invarient expansion It is possible to have a 1-instruction vertex shader before expanding pos_invarient. Not sure what this assert achieved, but at least move it where it is correct. --- src/mesa/state_tracker/st_atom_shader.c | 2 -- src/mesa/state_tracker/st_program.c | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mesa/state_tracker') diff --git a/src/mesa/state_tracker/st_atom_shader.c b/src/mesa/state_tracker/st_atom_shader.c index 6e311e537ef..9208f3f446f 100644 --- a/src/mesa/state_tracker/st_atom_shader.c +++ b/src/mesa/state_tracker/st_atom_shader.c @@ -287,8 +287,6 @@ find_translated_vp(struct st_context *st, #endif } - assert(stvp->Base.Base.NumInstructions > 1); - st_translate_vertex_program(st, stvp, xvp->output_to_slot, xvp->output_to_semantic_name, xvp->output_to_semantic_index); diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c index 190b6a5526d..cf19f8f1a8e 100644 --- a/src/mesa/state_tracker/st_program.c +++ b/src/mesa/state_tracker/st_program.c @@ -87,6 +87,8 @@ st_translate_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. -- cgit v1.2.3 From aa44efb04504fb6f8a1a2ff9d99388d173f7181a Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sat, 12 Dec 2009 22:17:16 -0800 Subject: st/mesa: Silence uninitialized variables warnings in st_draw.c. --- src/mesa/state_tracker/st_draw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mesa/state_tracker') diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c index c76bff91819..6f5248cbe57 100644 --- a/src/mesa/state_tracker/st_draw.c +++ b/src/mesa/state_tracker/st_draw.c @@ -371,7 +371,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]; @@ -550,7 +550,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) -- cgit v1.2.3 From ddfc2e74390d0c1df10da39112a6913ea518d349 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 16 Dec 2009 07:58:31 -0700 Subject: st/mesa: remove //-style comments --- src/mesa/state_tracker/st_atom.c | 8 ++++---- src/mesa/state_tracker/st_cb_bitmap.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/mesa/state_tracker') diff --git a/src/mesa/state_tracker/st_atom.c b/src/mesa/state_tracker/st_atom.c index ca15ce1b474..d6254aa7637 100644 --- a/src/mesa/state_tracker/st_atom.c +++ b/src/mesa/state_tracker/st_atom.c @@ -137,7 +137,7 @@ void st_validate_state( struct st_context *st ) if (state->st == 0) return; -// _mesa_printf("%s %x/%x\n", __FUNCTION__, state->mesa, state->st); + /* _mesa_printf("%s %x/%x\n", __FUNCTION__, state->mesa, state->st);*/ if (1) { /* Debug version which enforces various sanity checks on the @@ -152,7 +152,7 @@ void st_validate_state( struct st_context *st ) const struct st_tracked_state *atom = atoms[i]; struct st_state_flags generated; -// _mesa_printf("atom %s %x/%x\n", atom->name, atom->dirty.mesa, atom->dirty.st); + /*_mesa_printf("atom %s %x/%x\n", atom->name, atom->dirty.mesa, atom->dirty.st);*/ if (!(atom->dirty.mesa || atom->dirty.st) || !atom->update) { @@ -162,7 +162,7 @@ void st_validate_state( struct st_context *st ) if (check_state(state, &atom->dirty)) { atoms[i]->update( st ); -// _mesa_printf("after: %x\n", atom->dirty.mesa); + /*_mesa_printf("after: %x\n", atom->dirty.mesa);*/ } accumulate_state(&examined, &atom->dirty); @@ -175,7 +175,7 @@ void st_validate_state( struct st_context *st ) assert(!check_state(&examined, &generated)); prev = *state; } -// _mesa_printf("\n"); + /*_mesa_printf("\n");*/ } else { diff --git a/src/mesa/state_tracker/st_cb_bitmap.c b/src/mesa/state_tracker/st_cb_bitmap.c index 902fb38d1a7..d6ec5dabfa0 100644 --- a/src/mesa/state_tracker/st_cb_bitmap.c +++ b/src/mesa/state_tracker/st_cb_bitmap.c @@ -515,7 +515,7 @@ reset_cache(struct st_context *st) struct pipe_screen *screen = pipe->screen; struct bitmap_cache *cache = st->bitmap.cache; - //memset(cache->buffer, 0xff, sizeof(cache->buffer)); + /*memset(cache->buffer, 0xff, sizeof(cache->buffer));*/ cache->empty = GL_TRUE; cache->xmin = 1000000; -- cgit v1.2.3 From ace937f1651c64d7fb22917489e29761130aaa0d Mon Sep 17 00:00:00 2001 From: Younes Manton Date: Sun, 20 Dec 2009 20:11:55 -0500 Subject: st/mesa: Check for single level mipmap trees. The assert in util_gen_mipmap() caught it, although it does the right thing anyway. --- src/mesa/state_tracker/st_gen_mipmap.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/mesa/state_tracker') diff --git a/src/mesa/state_tracker/st_gen_mipmap.c b/src/mesa/state_tracker/st_gen_mipmap.c index f75b2348b82..c3bea3172a5 100644 --- a/src/mesa/state_tracker/st_gen_mipmap.c +++ b/src/mesa/state_tracker/st_gen_mipmap.c @@ -215,6 +215,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. -- cgit v1.2.3