gallium: use new buffer wrapper functions in p_inlines.h
This allows us to remove most of the direct references to winsys in the state tracker.
This commit is contained in:
@@ -35,7 +35,6 @@
|
||||
|
||||
#include "pipe/p_context.h"
|
||||
#include "pipe/p_defines.h"
|
||||
#include "pipe/p_winsys.h"
|
||||
#include "pipe/p_inlines.h"
|
||||
|
||||
|
||||
@@ -79,7 +78,7 @@ st_bufferobj_free(GLcontext *ctx, struct gl_buffer_object *obj)
|
||||
struct st_buffer_object *st_obj = st_buffer_object(obj);
|
||||
|
||||
if (st_obj->buffer)
|
||||
pipe_buffer_reference(pipe->winsys, &st_obj->buffer, NULL);
|
||||
pipe_reference_buffer(pipe, &st_obj->buffer, NULL);
|
||||
|
||||
free(st_obj);
|
||||
}
|
||||
@@ -106,10 +105,9 @@ st_bufferobj_subdata(GLcontext *ctx,
|
||||
if (offset >= st_obj->size || size > (st_obj->size - offset))
|
||||
return;
|
||||
|
||||
map = pipe->winsys->buffer_map(pipe->winsys, st_obj->buffer,
|
||||
PIPE_BUFFER_USAGE_CPU_WRITE);
|
||||
map = pipe_buffer_map(pipe, st_obj->buffer, PIPE_BUFFER_USAGE_CPU_WRITE);
|
||||
memcpy(map + offset, data, size);
|
||||
pipe->winsys->buffer_unmap(pipe->winsys, st_obj->buffer);
|
||||
pipe_buffer_unmap(pipe, st_obj->buffer);
|
||||
}
|
||||
|
||||
|
||||
@@ -130,10 +128,9 @@ st_bufferobj_get_subdata(GLcontext *ctx,
|
||||
if (offset >= st_obj->size || size > (st_obj->size - offset))
|
||||
return;
|
||||
|
||||
map = pipe->winsys->buffer_map(pipe->winsys, st_obj->buffer,
|
||||
PIPE_BUFFER_USAGE_CPU_READ);
|
||||
map = pipe_buffer_map(pipe, st_obj->buffer, PIPE_BUFFER_USAGE_CPU_READ);
|
||||
memcpy(data, map + offset, size);
|
||||
pipe->winsys->buffer_unmap(pipe->winsys, st_obj->buffer);
|
||||
pipe_buffer_unmap(pipe, st_obj->buffer);
|
||||
}
|
||||
|
||||
|
||||
@@ -174,10 +171,9 @@ st_bufferobj_data(GLcontext *ctx,
|
||||
buffer_usage = 0;
|
||||
}
|
||||
|
||||
pipe_buffer_reference( pipe->winsys, &st_obj->buffer, NULL );
|
||||
pipe_reference_buffer( pipe, &st_obj->buffer, NULL );
|
||||
|
||||
st_obj->buffer = pipe->winsys->buffer_create( pipe->winsys, 32, buffer_usage,
|
||||
size );
|
||||
st_obj->buffer = pipe_buffer_create( pipe, 32, buffer_usage, size );
|
||||
|
||||
st_obj->size = size;
|
||||
|
||||
@@ -211,7 +207,7 @@ st_bufferobj_map(GLcontext *ctx, GLenum target, GLenum access,
|
||||
break;
|
||||
}
|
||||
|
||||
obj->Pointer = pipe->winsys->buffer_map(pipe->winsys, st_obj->buffer, flags);
|
||||
obj->Pointer = pipe_buffer_map(pipe, st_obj->buffer, flags);
|
||||
return obj->Pointer;
|
||||
}
|
||||
|
||||
@@ -225,7 +221,7 @@ st_bufferobj_unmap(GLcontext *ctx, GLenum target, struct gl_buffer_object *obj)
|
||||
struct pipe_context *pipe = st_context(ctx)->pipe;
|
||||
struct st_buffer_object *st_obj = st_buffer_object(obj);
|
||||
|
||||
pipe->winsys->buffer_unmap(pipe->winsys, st_obj->buffer);
|
||||
pipe_buffer_unmap(pipe, st_obj->buffer);
|
||||
obj->Pointer = NULL;
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
Reference in New Issue
Block a user