st/mesa: minor clean-ups, reformatting, etc

This commit is contained in:
Brian Paul
2009-06-02 21:46:17 -06:00
parent 5cd47e0361
commit 54576130a8

View File

@@ -26,6 +26,11 @@
**************************************************************************/ **************************************************************************/
/**
* Functions for pixel buffer objects and vertex/element buffer objects.
*/
#include "main/imports.h" #include "main/imports.h"
#include "main/mtypes.h" #include "main/mtypes.h"
#include "main/arrayobj.h" #include "main/arrayobj.h"
@@ -40,14 +45,6 @@
#include "pipe/p_inlines.h" #include "pipe/p_inlines.h"
/* Pixel buffers and Vertex/index buffers are handled through these
* mesa callbacks. Framebuffer/Renderbuffer objects are
* created/managed elsewhere.
*/
/** /**
* There is some duplication between mesa's bufferobjects and our * There is some duplication between mesa's bufferobjects and our
* bufmgr buffers. Both have an integer handle and a hashtable to * bufmgr buffers. Both have an integer handle and a hashtable to
@@ -191,7 +188,7 @@ st_bufferobj_map(GLcontext *ctx, GLenum target, GLenum access,
struct gl_buffer_object *obj) struct gl_buffer_object *obj)
{ {
struct st_buffer_object *st_obj = st_buffer_object(obj); struct st_buffer_object *st_obj = st_buffer_object(obj);
GLuint flags; uint flags;
switch (access) { switch (access) {
case GL_WRITE_ONLY: case GL_WRITE_ONLY:
@@ -210,7 +207,7 @@ st_bufferobj_map(GLcontext *ctx, GLenum target, GLenum access,
obj->Pointer = st_cond_flush_pipe_buffer_map(st_context(ctx), obj->Pointer = st_cond_flush_pipe_buffer_map(st_context(ctx),
st_obj->buffer, st_obj->buffer,
flags); flags);
if(obj->Pointer) { if (obj->Pointer) {
obj->Offset = 0; obj->Offset = 0;
obj->Length = obj->Size; obj->Length = obj->Size;
} }
@@ -218,7 +215,6 @@ st_bufferobj_map(GLcontext *ctx, GLenum target, GLenum access,
} }
/** /**
* Called via glMapBufferRange(). * Called via glMapBufferRange().
*/ */
@@ -229,7 +225,7 @@ st_bufferobj_map_range(GLcontext *ctx, GLenum target,
{ {
struct pipe_context *pipe = st_context(ctx)->pipe; struct pipe_context *pipe = st_context(ctx)->pipe;
struct st_buffer_object *st_obj = st_buffer_object(obj); struct st_buffer_object *st_obj = st_buffer_object(obj);
GLuint flags = 0; uint flags = 0x0;
char *map; char *map;
if (access & GL_MAP_WRITE_BIT) if (access & GL_MAP_WRITE_BIT)
@@ -249,8 +245,9 @@ st_bufferobj_map_range(GLcontext *ctx, GLenum target,
assert(offset < obj->Size); assert(offset < obj->Size);
assert(offset + length <= obj->Size); assert(offset + length <= obj->Size);
map = obj->Pointer = pipe_buffer_map_range(pipe->screen, st_obj->buffer, offset, length, flags); map = obj->Pointer = pipe_buffer_map_range(pipe->screen, st_obj->buffer,
if(obj->Pointer) { offset, length, flags);
if (obj->Pointer) {
obj->Offset = 0; obj->Offset = 0;
obj->Length = obj->Size; obj->Length = obj->Size;
map += offset; map += offset;