diff options
author | Ben Skeggs <[email protected]> | 2008-07-11 00:05:53 +1000 |
---|---|---|
committer | Ben Skeggs <[email protected]> | 2008-07-11 00:05:53 +1000 |
commit | 19171ab1d30f14ac0d39894125a3d53a91ca5b89 (patch) | |
tree | 7adb5b8317f9acfe1f4f0ba2e10dd79b228cd57d /src/mesa/state_tracker | |
parent | 225863aeb5f2dfe4980ae5887f5623ecb05e9ced (diff) | |
parent | 64f92e00c8292113f9a6372959febe903af09db6 (diff) |
Merge remote branch 'upstream/gallium-0.1' into nouveau-gallium-0.1
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r-- | src/mesa/state_tracker/st_cb_fbo.c | 3 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_draw.c | 26 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_format.c | 5 |
3 files changed, 29 insertions, 5 deletions
diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c index 7245798d0da..8406bf247fc 100644 --- a/src/mesa/state_tracker/st_cb_fbo.c +++ b/src/mesa/state_tracker/st_cb_fbo.c @@ -422,7 +422,8 @@ st_finish_render_texture(GLcontext *ctx, struct pipe_screen *screen = ctx->st->pipe->screen; struct st_renderbuffer *strb = st_renderbuffer(att->Renderbuffer); - assert(strb); + if (!strb) + return; ctx->st->pipe->flush(ctx->st->pipe, PIPE_FLUSH_RENDER_CACHE, NULL); diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c index 21911774d79..a57d7b6a7aa 100644 --- a/src/mesa/state_tracker/st_draw.c +++ b/src/mesa/state_tracker/st_draw.c @@ -300,9 +300,8 @@ st_draw_vbo(GLcontext *ctx, vbuffer[attr].buffer = NULL; pipe_reference_buffer(pipe, &vbuffer[attr].buffer, stobj->buffer); - vbuffer[attr].buffer_offset = (unsigned) arrays[0]->Ptr;/* in bytes */ - velements[attr].src_offset = arrays[mesaAttr]->Ptr - arrays[0]->Ptr; - assert(velements[attr].src_offset <= 2048); /* 11-bit field */ + vbuffer[attr].buffer_offset = (unsigned) arrays[mesaAttr]->Ptr; + velements[attr].src_offset = 0; } else { /* attribute data is in user-space memory, not a VBO */ @@ -323,6 +322,8 @@ st_draw_vbo(GLcontext *ctx, velements[attr].src_offset = 0; } + assert(velements[attr].src_offset <= 2048); /* 11-bit field */ + /* common-case setup */ vbuffer[attr].pitch = arrays[mesaAttr]->StrideB; /* in bytes */ vbuffer[attr].max_index = max_index; @@ -335,6 +336,25 @@ st_draw_vbo(GLcontext *ctx, assert(velements[attr].src_format); } +#if 0 + { + GLuint i; + char buf[100]; + for (i = 0; i < vp->num_inputs; i++) { + printf("buffers[%d].pitch = %u\n", i, vbuffer[i].pitch); + printf("buffers[%d].max_index = %u\n", i, vbuffer[i].max_index); + printf("buffers[%d].buffer_offset = %u\n", i, vbuffer[i].buffer_offset); + printf("buffers[%d].buffer = %p\n", i, (void*) vbuffer[i].buffer); + } + for (i = 0; i < vp->num_inputs; i++) { + printf("vlements[%d].src_offset = %u\n", i, velements[i].src_offset); + printf("vlements[%d].vbuffer_index = %u\n", i, velements[i].vertex_buffer_index); + printf("vlements[%d].nr_comps = %u\n", i, velements[i].nr_components); + printf("vlements[%d].format = %s\n", i, pf_sprint_name(buf, velements[i].src_format)); + } + } +#endif + pipe->set_vertex_buffers(pipe, vp->num_inputs, vbuffer); pipe->set_vertex_elements(pipe, vp->num_inputs, velements); diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c index 03ec558a367..50a06868dfc 100644 --- a/src/mesa/state_tracker/st_format.c +++ b/src/mesa/state_tracker/st_format.c @@ -362,7 +362,10 @@ st_choose_format(struct pipe_context *pipe, GLint internalFormat, case GL_RGBA12: return default_rgba_format( screen, surfType ); case GL_RGBA16: - return default_deep_rgba_format( screen, surfType ); + if (surfType == PIPE_SURFACE) + return default_deep_rgba_format( screen, surfType ); + else + return default_rgba_format( screen, surfType ); case GL_RGBA4: case GL_RGBA2: |