#include "util/u_memory.h"
#include "api_exec_decl.h"
-#include "state_tracker/st_cb_bufferobjects.h"
-
const GLubyte
_mesa_vao_attribute_map[ATTRIBUTE_MAP_MODE_MAX][VERT_ATTRIB_MAX] =
{
if (_mesa_bufferobj_mapped(bo, MAP_INTERNAL))
continue;
- st_bufferobj_map_range(ctx, 0, bo->Size, access, bo, MAP_INTERNAL);
+ _mesa_bufferobj_map_range(ctx, 0, bo->Size, access, bo, MAP_INTERNAL);
}
}
/* map the index buffer, if there is one, and not already mapped */
if (bo && !_mesa_bufferobj_mapped(bo, MAP_INTERNAL))
- st_bufferobj_map_range(ctx, 0, bo->Size, access, bo, MAP_INTERNAL);
+ _mesa_bufferobj_map_range(ctx, 0, bo->Size, access, bo, MAP_INTERNAL);
_mesa_vao_map_arrays(ctx, vao, access);
}
if (!_mesa_bufferobj_mapped(bo, MAP_INTERNAL))
continue;
- st_bufferobj_unmap(ctx, bo, MAP_INTERNAL);
+ _mesa_bufferobj_unmap(ctx, bo, MAP_INTERNAL);
}
}
/* unmap the index buffer, if there is one, and still mapped */
if (bo && _mesa_bufferobj_mapped(bo, MAP_INTERNAL))
- st_bufferobj_unmap(ctx, bo, MAP_INTERNAL);
+ _mesa_bufferobj_unmap(ctx, bo, MAP_INTERNAL);
_mesa_vao_unmap_arrays(ctx, vao);
}
* Called via glBufferSubDataARB().
*/
void
-st_bufferobj_subdata(struct gl_context *ctx,
- GLintptrARB offset,
- GLsizeiptrARB size,
- const void * data, struct gl_buffer_object *obj)
+_mesa_bufferobj_subdata(struct gl_context *ctx,
+ GLintptrARB offset,
+ GLsizeiptrARB size,
+ const void *data, struct gl_buffer_object *obj)
{
/* we may be called from VBO code, so double-check params here */
assert(offset >= 0);
obj->Usage = usage;
obj->StorageFlags = storageFlags;
- mesa_buffer_object_release_buffer(obj);
+ _mesa_bufferobj_release_buffer(obj);
unsigned bindings = buffer_target_to_bind_flags(target);
* \return GL_TRUE for success, GL_FALSE if out of memory
*/
GLboolean
-st_bufferobj_data(struct gl_context *ctx,
+_mesa_bufferobj_data(struct gl_context *ctx,
GLenum target,
GLsizeiptrARB size,
const void *data,
}
static GLboolean
-st_bufferobj_data_mem(struct gl_context *ctx,
- GLenum target,
- GLsizeiptrARB size,
- struct gl_memory_object *memObj,
- GLuint64 offset,
- GLenum usage,
- struct gl_buffer_object *bufObj)
+bufferobj_data_mem(struct gl_context *ctx,
+ GLenum target,
+ GLsizeiptrARB size,
+ struct gl_memory_object *memObj,
+ GLuint64 offset,
+ GLenum usage,
+ struct gl_buffer_object *bufObj)
{
return bufferobj_data(ctx, target, size, NULL, memObj, offset, usage, 0, bufObj);
}
* Called via glMapBufferRange().
*/
void *
-st_bufferobj_map_range(struct gl_context *ctx,
- GLintptr offset, GLsizeiptr length, GLbitfield access,
- struct gl_buffer_object *obj,
- gl_map_buffer_index index)
+_mesa_bufferobj_map_range(struct gl_context *ctx,
+ GLintptr offset, GLsizeiptr length, GLbitfield access,
+ struct gl_buffer_object *obj,
+ gl_map_buffer_index index)
{
struct pipe_context *pipe = ctx->pipe;
void
-st_bufferobj_flush_mapped_range(struct gl_context *ctx,
- GLintptr offset, GLsizeiptr length,
- struct gl_buffer_object *obj,
- gl_map_buffer_index index)
+_mesa_bufferobj_flush_mapped_range(struct gl_context *ctx,
+ GLintptr offset, GLsizeiptr length,
+ struct gl_buffer_object *obj,
+ gl_map_buffer_index index)
{
struct pipe_context *pipe = ctx->pipe;
* Called via glUnmapBufferARB().
*/
GLboolean
-st_bufferobj_unmap(struct gl_context *ctx, struct gl_buffer_object *obj,
- gl_map_buffer_index index)
+_mesa_bufferobj_unmap(struct gl_context *ctx, struct gl_buffer_object *obj,
+ gl_map_buffer_index index)
{
struct pipe_context *pipe = ctx->pipe;
}
void
-mesa_buffer_object_release_buffer(struct gl_buffer_object *obj)
+_mesa_bufferobj_release_buffer(struct gl_buffer_object *obj)
{
if (!obj->buffer)
return;
{
assert(bufObj->RefCount == 0);
_mesa_buffer_unmap_all_mappings(ctx, bufObj);
- mesa_buffer_object_release_buffer(bufObj);
+ _mesa_bufferobj_release_buffer(bufObj);
vbo_delete_minmax_cache(bufObj);
align_free(bufObj->Data);
GLsizeiptr i;
GLubyte *dest;
- dest = st_bufferobj_map_range(ctx, offset, size,
- GL_MAP_WRITE_BIT |
- GL_MAP_INVALIDATE_RANGE_BIT,
- bufObj, MAP_INTERNAL);
+ dest = _mesa_bufferobj_map_range(ctx, offset, size,
+ GL_MAP_WRITE_BIT |
+ GL_MAP_INVALIDATE_RANGE_BIT,
+ bufObj, MAP_INTERNAL);
if (!dest) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glClearBuffer[Sub]Data");
if (clearValue == NULL) {
/* Clear with zeros, per the spec */
memset(dest, 0, size);
- st_bufferobj_unmap(ctx, bufObj, MAP_INTERNAL);
+ _mesa_bufferobj_unmap(ctx, bufObj, MAP_INTERNAL);
return;
}
dest += clearValueSize;
}
- st_bufferobj_unmap(ctx, bufObj, MAP_INTERNAL);
+ _mesa_bufferobj_unmap(ctx, bufObj, MAP_INTERNAL);
}
/**
}
struct gl_buffer_object *
-_mesa_internal_buffer_object_alloc(struct gl_context *ctx, GLuint id)
+_mesa_bufferobj_alloc(struct gl_context *ctx, GLuint id)
{
struct gl_buffer_object *buf = CALLOC_STRUCT(gl_buffer_object);
if (!buf)
static struct gl_buffer_object *
new_gl_buffer_object(struct gl_context *ctx, GLuint id)
{
- struct gl_buffer_object *buf = _mesa_internal_buffer_object_alloc(ctx, id);
+ struct gl_buffer_object *buf = _mesa_bufferobj_alloc(ctx, id);
buf->Ctx = ctx;
buf->RefCount++; /* global buffer reference held by the context */
{
for (int i = 0; i < MAP_COUNT; i++) {
if (_mesa_bufferobj_mapped(bufObj, i)) {
- st_bufferobj_unmap(ctx, bufObj, i);
+ _mesa_bufferobj_unmap(ctx, bufObj, i);
assert(bufObj->Mappings[i].Pointer == NULL);
bufObj->Mappings[i].AccessFlags = 0;
}
bufObj->MinMaxCacheDirty = true;
if (memObj) {
- res = st_bufferobj_data_mem(ctx, target, size, memObj, offset,
- GL_DYNAMIC_DRAW, bufObj);
+ res = bufferobj_data_mem(ctx, target, size, memObj, offset,
+ GL_DYNAMIC_DRAW, bufObj);
}
else {
- res = st_bufferobj_data(ctx, target, size, data, GL_DYNAMIC_DRAW,
- flags, bufObj);
+ res = _mesa_bufferobj_data(ctx, target, size, data, GL_DYNAMIC_DRAW,
+ flags, bufObj);
}
if (!res) {
size += 100;
#endif
- if (!st_bufferobj_data(ctx, target, size, data, usage,
- GL_MAP_READ_BIT |
- GL_MAP_WRITE_BIT |
- GL_DYNAMIC_STORAGE_BIT,
- bufObj)) {
+ if (!_mesa_bufferobj_data(ctx, target, size, data, usage,
+ GL_MAP_READ_BIT |
+ GL_MAP_WRITE_BIT |
+ GL_DYNAMIC_STORAGE_BIT,
+ bufObj)) {
if (target == GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD) {
if (!no_error) {
/* From GL_AMD_pinned_memory:
bufObj->Written = GL_TRUE;
bufObj->MinMaxCacheDirty = true;
- st_bufferobj_subdata(ctx, offset, size, data, bufObj);
+ _mesa_bufferobj_subdata(ctx, offset, size, data, bufObj);
}
static GLboolean
unmap_buffer(struct gl_context *ctx, struct gl_buffer_object *bufObj)
{
- GLboolean status = st_bufferobj_unmap(ctx, bufObj, MAP_USER);
+ GLboolean status = _mesa_bufferobj_unmap(ctx, bufObj, MAP_USER);
bufObj->Mappings[MAP_USER].AccessFlags = 0;
assert(bufObj->Mappings[MAP_USER].Pointer == NULL);
assert(bufObj->Mappings[MAP_USER].Offset == 0);
return NULL;
}
- void *map = st_bufferobj_map_range(ctx, offset, length, access, bufObj,
- MAP_USER);
+ void *map = _mesa_bufferobj_map_range(ctx, offset, length, access, bufObj,
+ MAP_USER);
if (!map) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "%s(map failed)", func);
}
assert(bufObj->Mappings[MAP_USER].AccessFlags & GL_MAP_WRITE_BIT);
- st_bufferobj_flush_mapped_range(ctx, offset, length, bufObj,
- MAP_USER);
+ _mesa_bufferobj_flush_mapped_range(ctx, offset, length, bufObj,
+ MAP_USER);
}
void GLAPIENTRY
struct gl_buffer_object **bufObjPtr = get_buffer_target(ctx, target);
struct gl_buffer_object *bufObj = *bufObjPtr;
- st_bufferobj_flush_mapped_range(ctx, offset, length, bufObj,
- MAP_USER);
+ _mesa_bufferobj_flush_mapped_range(ctx, offset, length, bufObj,
+ MAP_USER);
}
void GLAPIENTRY
GET_CURRENT_CONTEXT(ctx);
struct gl_buffer_object *bufObj = _mesa_lookup_bufferobj(ctx, buffer);
- st_bufferobj_flush_mapped_range(ctx, offset, length, bufObj,
- MAP_USER);
+ _mesa_bufferobj_flush_mapped_range(ctx, offset, length, bufObj,
+ MAP_USER);
}
void GLAPIENTRY
*/
static inline struct pipe_resource *
-_mesa_get_buffer_object_reference(struct gl_context *ctx, struct gl_buffer_object *obj)
+_mesa_get_bufferobj_reference(struct gl_context *ctx, struct gl_buffer_object *obj)
{
if (unlikely(!obj))
return NULL;
return buffer;
}
-void st_bufferobj_subdata(struct gl_context *ctx,
+void _mesa_bufferobj_subdata(struct gl_context *ctx,
GLintptrARB offset,
GLsizeiptrARB size,
const void * data, struct gl_buffer_object *obj);
-GLboolean st_bufferobj_data(struct gl_context *ctx,
+GLboolean _mesa_bufferobj_data(struct gl_context *ctx,
GLenum target,
GLsizeiptrARB size,
const void *data,
GLenum usage,
GLbitfield storageFlags,
struct gl_buffer_object *obj);
-void *st_bufferobj_map_range(struct gl_context *ctx,
- GLintptr offset, GLsizeiptr length,
- GLbitfield access,
- struct gl_buffer_object *obj,
- gl_map_buffer_index index);
-
-void st_bufferobj_flush_mapped_range(struct gl_context *ctx,
- GLintptr offset, GLsizeiptr length,
- struct gl_buffer_object *obj,
- gl_map_buffer_index index);
-GLboolean st_bufferobj_unmap(struct gl_context *ctx, struct gl_buffer_object *obj,
- gl_map_buffer_index index);
+void *_mesa_bufferobj_map_range(struct gl_context *ctx,
+ GLintptr offset, GLsizeiptr length,
+ GLbitfield access,
+ struct gl_buffer_object *obj,
+ gl_map_buffer_index index);
+
+void _mesa_bufferobj_flush_mapped_range(struct gl_context *ctx,
+ GLintptr offset, GLsizeiptr length,
+ struct gl_buffer_object *obj,
+ gl_map_buffer_index index);
+GLboolean _mesa_bufferobj_unmap(struct gl_context *ctx, struct gl_buffer_object *obj,
+ gl_map_buffer_index index);
struct gl_buffer_object *
-_mesa_internal_buffer_object_alloc(struct gl_context *ctx, GLuint id);
+_mesa_bufferobj_alloc(struct gl_context *ctx, GLuint id);
void
-mesa_buffer_object_release_buffer(struct gl_buffer_object *obj);
+_mesa_bufferobj_release_buffer(struct gl_buffer_object *obj);
/** Is the given buffer object currently mapped by the GL user? */
static inline GLboolean
#include "state_tracker/st_cb_texture.h"
#include "state_tracker/st_cb_bitmap.h"
-#include "state_tracker/st_cb_bufferobjects.h"
#define USE_BITMAP_ATLAS 1
GLvoid *image;
map = (GLubyte *)
- st_bufferobj_map_range(ctx, 0, unpack->BufferObj->Size,
- GL_MAP_READ_BIT, unpack->BufferObj,
- MAP_INTERNAL);
+ _mesa_bufferobj_map_range(ctx, 0, unpack->BufferObj->Size,
+ GL_MAP_READ_BIT, unpack->BufferObj,
+ MAP_INTERNAL);
if (!map) {
/* unable to map src buffer! */
_mesa_error(ctx, GL_INVALID_OPERATION, "unable to map PBO");
image = _mesa_unpack_image(dimensions, width, height, depth,
format, type, src, unpack);
- st_bufferobj_unmap(ctx, unpack->BufferObj, MAP_INTERNAL);
+ _mesa_bufferobj_unmap(ctx, unpack->BufferObj, MAP_INTERNAL);
if (!image) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "display list construction");
#include "main/dispatch.h"
#include "main/bufferobj.h"
-#include "state_tracker/st_cb_bufferobjects.h"
-
/**
* Create an upload buffer. This is called from the app thread, so everything
* has to be thread-safe in the driver.
assert(ctx->GLThread.SupportsBufferUploads);
struct gl_buffer_object *obj =
- _mesa_internal_buffer_object_alloc(ctx, -1);
+ _mesa_bufferobj_alloc(ctx, -1);
if (!obj)
return NULL;
obj->Immutable = true;
- if (!st_bufferobj_data(ctx, GL_ARRAY_BUFFER, size, NULL,
+ if (!_mesa_bufferobj_data(ctx, GL_ARRAY_BUFFER, size, NULL,
GL_WRITE_ONLY,
GL_CLIENT_STORAGE_BIT | GL_MAP_WRITE_BIT,
obj)) {
return NULL;
}
- *ptr = st_bufferobj_map_range(ctx, 0, size,
+ *ptr = _mesa_bufferobj_map_range(ctx, 0, size,
GL_MAP_WRITE_BIT |
GL_MAP_UNSYNCHRONIZED_BIT |
MESA_MAP_THREAD_SAFE_BIT,
#include "macros.h"
#include "pbo.h"
-#include "state_tracker/st_cb_bufferobjects.h"
-
-
/**
* When we're about to read pixel data out of a PBO (via glDrawPixels,
* glTexImage, etc) or write data into a PBO (via glReadPixels,
if (unpack->BufferObj) {
/* unpack from PBO */
- buf = (GLubyte *) st_bufferobj_map_range(ctx, 0,
- unpack->BufferObj->Size,
- GL_MAP_READ_BIT,
- unpack->BufferObj,
- MAP_INTERNAL);
+ buf = (GLubyte *) _mesa_bufferobj_map_range(ctx, 0,
+ unpack->BufferObj->Size,
+ GL_MAP_READ_BIT,
+ unpack->BufferObj,
+ MAP_INTERNAL);
if (!buf)
return NULL;
{
assert(unpack != &ctx->Pack); /* catch pack/unpack mismatch */
if (unpack->BufferObj) {
- st_bufferobj_unmap(ctx, unpack->BufferObj, MAP_INTERNAL);
+ _mesa_bufferobj_unmap(ctx, unpack->BufferObj, MAP_INTERNAL);
}
}
if (pack->BufferObj) {
/* pack into PBO */
- buf = (GLubyte *) st_bufferobj_map_range(ctx, 0,
- pack->BufferObj->Size,
- GL_MAP_WRITE_BIT,
- pack->BufferObj,
- MAP_INTERNAL);
+ buf = (GLubyte *) _mesa_bufferobj_map_range(ctx, 0,
+ pack->BufferObj->Size,
+ GL_MAP_WRITE_BIT,
+ pack->BufferObj,
+ MAP_INTERNAL);
if (!buf)
return NULL;
{
assert(pack != &ctx->Unpack); /* catch pack/unpack mismatch */
if (pack->BufferObj) {
- st_bufferobj_unmap(ctx, pack->BufferObj, MAP_INTERNAL);
+ _mesa_bufferobj_unmap(ctx, pack->BufferObj, MAP_INTERNAL);
}
}
return NULL;
}
- buf = (GLubyte *) st_bufferobj_map_range(ctx, 0,
- unpack->BufferObj->Size,
- GL_MAP_READ_BIT,
- unpack->BufferObj,
- MAP_INTERNAL);
+ buf = (GLubyte *) _mesa_bufferobj_map_range(ctx, 0,
+ unpack->BufferObj->Size,
+ GL_MAP_READ_BIT,
+ unpack->BufferObj,
+ MAP_INTERNAL);
if (!buf) {
_mesa_error(ctx, GL_INVALID_OPERATION, "%s%uD(PBO is mapped)", funcName,
dimensions);
return pixels;
}
- buf = (GLubyte*) st_bufferobj_map_range(ctx, 0,
- packing->BufferObj->Size,
- GL_MAP_READ_BIT,
- packing->BufferObj,
- MAP_INTERNAL);
+ buf = (GLubyte*) _mesa_bufferobj_map_range(ctx, 0,
+ packing->BufferObj->Size,
+ GL_MAP_READ_BIT,
+ packing->BufferObj,
+ MAP_INTERNAL);
/* Validation above already checked that PBO is not mapped, so buffer
* should not be null.
const struct gl_pixelstore_attrib *unpack)
{
if (unpack->BufferObj) {
- st_bufferobj_unmap(ctx, unpack->BufferObj, MAP_INTERNAL);
+ _mesa_bufferobj_unmap(ctx, unpack->BufferObj, MAP_INTERNAL);
}
}
#include "api_exec_decl.h"
#include "state_tracker/st_cb_texture.h"
-#include "state_tracker/st_cb_bufferobjects.h"
/**
* Can the given type represent negative values?
* texture data to the PBO if the PBO is in VRAM along with the texture.
*/
GLubyte *buf = (GLubyte *)
- st_bufferobj_map_range(ctx, 0, ctx->Pack.BufferObj->Size,
- GL_MAP_WRITE_BIT, ctx->Pack.BufferObj,
- MAP_INTERNAL);
+ _mesa_bufferobj_map_range(ctx, 0, ctx->Pack.BufferObj->Size,
+ GL_MAP_WRITE_BIT, ctx->Pack.BufferObj,
+ MAP_INTERNAL);
if (!buf) {
/* out of memory or other unexpected error */
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glGetTexImage(map PBO failed)");
}
if (ctx->Pack.BufferObj) {
- st_bufferobj_unmap(ctx, ctx->Pack.BufferObj, MAP_INTERNAL);
+ _mesa_bufferobj_unmap(ctx, ctx->Pack.BufferObj, MAP_INTERNAL);
}
}
if (ctx->Pack.BufferObj) {
/* pack texture image into a PBO */
dest = (GLubyte *)
- st_bufferobj_map_range(ctx, 0, ctx->Pack.BufferObj->Size,
- GL_MAP_WRITE_BIT, ctx->Pack.BufferObj,
- MAP_INTERNAL);
+ _mesa_bufferobj_map_range(ctx, 0, ctx->Pack.BufferObj->Size,
+ GL_MAP_WRITE_BIT, ctx->Pack.BufferObj,
+ MAP_INTERNAL);
if (!dest) {
/* out of memory or other unexpected error */
_mesa_error(ctx, GL_OUT_OF_MEMORY,
}
if (ctx->Pack.BufferObj) {
- st_bufferobj_unmap(ctx, ctx->Pack.BufferObj, MAP_INTERNAL);
+ _mesa_bufferobj_unmap(ctx, ctx->Pack.BufferObj, MAP_INTERNAL);
}
}
/* Set the vertex buffer. */
if (binding->BufferObj) {
vbuffer[bufidx].buffer.resource =
- _mesa_get_buffer_object_reference(ctx, binding->BufferObj);
+ _mesa_get_bufferobj_reference(ctx, binding->BufferObj);
vbuffer[bufidx].is_user_buffer = false;
vbuffer[bufidx].buffer_offset = binding->Offset +
attrib->RelativeOffset;
if (binding->BufferObj) {
/* Set the binding */
vbuffer[bufidx].buffer.resource =
- _mesa_get_buffer_object_reference(ctx, binding->BufferObj);
+ _mesa_get_bufferobj_reference(ctx, binding->BufferObj);
vbuffer[bufidx].is_user_buffer = false;
vbuffer[bufidx].buffer_offset = _mesa_draw_binding_offset(binding);
} else {
binding =
&st->ctx->UniformBufferBindings[prog->sh.UniformBlocks[i]->Binding];
- cb.buffer = _mesa_get_buffer_object_reference(st->ctx, binding->BufferObject);
+ cb.buffer = _mesa_get_bufferobj_reference(st->ctx, binding->BufferObject);
if (cb.buffer) {
cb.buffer_offset = binding->Offset;
* the threaded batch buffer.
*/
info->index.resource =
- _mesa_get_buffer_object_reference(ctx, info->index.gl_bo);
+ _mesa_get_bufferobj_reference(ctx, info->index.gl_bo);
info->take_index_buffer_ownership = true;
} else {
info->index.resource = info->index.gl_bo->buffer;
#include "vbo_private.h"
-#include "state_tracker/st_cb_bufferobjects.h"
-
/** ID/name for immediate-mode VBO */
#define IMM_BUFFER_NAME 0xaabbccdd
{
struct gl_context *ctx = gl_context_from_vbo_exec(exec);
- exec->vtx.bufferobj = _mesa_internal_buffer_object_alloc(ctx, IMM_BUFFER_NAME);
+ exec->vtx.bufferobj = _mesa_bufferobj_alloc(ctx, IMM_BUFFER_NAME);
exec->vtx.enabled = u_bit_consecutive64(0, VBO_ATTRIB_MAX); /* reset all */
vbo_reset_all_attr(exec);
*/
if (exec->vtx.bufferobj &&
_mesa_bufferobj_mapped(exec->vtx.bufferobj, MAP_INTERNAL)) {
- st_bufferobj_unmap(ctx, exec->vtx.bufferobj, MAP_INTERNAL);
+ _mesa_bufferobj_unmap(ctx, exec->vtx.bufferobj, MAP_INTERNAL);
}
_mesa_reference_buffer_object(ctx, &exec->vtx.bufferobj, NULL);
}
#include "vbo_private.h"
-#include "state_tracker/st_cb_bufferobjects.h"
-
static void
vbo_exec_debug_verts(struct vbo_exec_context *exec)
{
sizeof(float);
if (length)
- st_bufferobj_flush_mapped_range(ctx, offset, length,
- exec->vtx.bufferobj,
- MAP_INTERNAL);
+ _mesa_bufferobj_flush_mapped_range(ctx, offset, length,
+ exec->vtx.bufferobj,
+ MAP_INTERNAL);
}
exec->vtx.buffer_used += (exec->vtx.buffer_ptr -
assert(exec->vtx.buffer_used <= ctx->Const.glBeginEndBufferSize);
assert(exec->vtx.buffer_ptr != NULL);
- st_bufferobj_unmap(ctx, exec->vtx.bufferobj, MAP_INTERNAL);
+ _mesa_bufferobj_unmap(ctx, exec->vtx.bufferobj, MAP_INTERNAL);
exec->vtx.buffer_map = NULL;
exec->vtx.buffer_ptr = NULL;
exec->vtx.max_vert = 0;
/* The VBO exists and there's room for more */
if (exec->vtx.bufferobj->Size > 0) {
exec->vtx.buffer_map = (fi_type *)
- st_bufferobj_map_range(ctx,
- exec->vtx.buffer_used,
- ctx->Const.glBeginEndBufferSize
- - exec->vtx.buffer_used,
- accessRange,
- exec->vtx.bufferobj,
- MAP_INTERNAL);
+ _mesa_bufferobj_map_range(ctx,
+ exec->vtx.buffer_used,
+ ctx->Const.glBeginEndBufferSize
+ - exec->vtx.buffer_used,
+ accessRange,
+ exec->vtx.bufferobj,
+ MAP_INTERNAL);
exec->vtx.buffer_ptr = exec->vtx.buffer_map;
}
else {
/* Need to allocate a new VBO */
exec->vtx.buffer_used = 0;
- if (st_bufferobj_data(ctx, GL_ARRAY_BUFFER_ARB,
- ctx->Const.glBeginEndBufferSize,
- NULL, usage,
- GL_MAP_WRITE_BIT |
- (ctx->Extensions.ARB_buffer_storage ?
- GL_MAP_PERSISTENT_BIT |
- GL_MAP_COHERENT_BIT |
- GL_MAP_READ_BIT : 0) |
- GL_DYNAMIC_STORAGE_BIT |
- GL_CLIENT_STORAGE_BIT,
- exec->vtx.bufferobj)) {
+ if (_mesa_bufferobj_data(ctx, GL_ARRAY_BUFFER_ARB,
+ ctx->Const.glBeginEndBufferSize,
+ NULL, usage,
+ GL_MAP_WRITE_BIT |
+ (ctx->Extensions.ARB_buffer_storage ?
+ GL_MAP_PERSISTENT_BIT |
+ GL_MAP_COHERENT_BIT |
+ GL_MAP_READ_BIT : 0) |
+ GL_DYNAMIC_STORAGE_BIT |
+ GL_CLIENT_STORAGE_BIT,
+ exec->vtx.bufferobj)) {
/* buffer allocation worked, now map the buffer */
exec->vtx.buffer_map =
- (fi_type *)st_bufferobj_map_range(ctx,
- 0, ctx->Const.glBeginEndBufferSize,
- accessRange,
- exec->vtx.bufferobj,
- MAP_INTERNAL);
+ (fi_type *)_mesa_bufferobj_map_range(ctx,
+ 0, ctx->Const.glBeginEndBufferSize,
+ accessRange,
+ exec->vtx.bufferobj,
+ MAP_INTERNAL);
}
else {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "VBO allocation");
#include "util/u_memory.h"
#include "pipe/p_state.h"
-#include "state_tracker/st_cb_bufferobjects.h"
-
struct minmax_cache_key {
GLintptr offset;
GLuint count;
max_index))
return;
- indices = st_bufferobj_map_range(ctx, offset, size, GL_MAP_READ_BIT,
- obj, MAP_INTERNAL);
+ indices = _mesa_bufferobj_map_range(ctx, offset, size, GL_MAP_READ_BIT,
+ obj, MAP_INTERNAL);
}
vbo_get_minmax_index_mapped(count, index_size, restart_index,
if (obj) {
vbo_minmax_cache_store(ctx, obj, index_size, offset, count, *min_index,
*max_index);
- st_bufferobj_unmap(ctx, obj, MAP_INTERNAL);
+ _mesa_bufferobj_unmap(ctx, obj, MAP_INTERNAL);
}
}
#include "api_exec_decl.h"
#include "api_save.h"
-#include "state_tracker/st_cb_bufferobjects.h"
-
#ifdef ERROR
#undef ERROR
#endif
if (total_bytes_needed > available_bytes) {
if (save->current_bo)
_mesa_reference_buffer_object(ctx, &save->current_bo, NULL);
- save->current_bo = _mesa_internal_buffer_object_alloc(ctx, VBO_BUF_ID + 1);
- bool success = st_bufferobj_data(ctx,
- GL_ELEMENT_ARRAY_BUFFER_ARB,
- MAX2(total_bytes_needed, VBO_SAVE_BUFFER_SIZE),
- NULL,
- GL_STATIC_DRAW_ARB, GL_MAP_WRITE_BIT |
- MESA_GALLIUM_VERTEX_STATE_STORAGE,
- save->current_bo);
+ save->current_bo = _mesa_bufferobj_alloc(ctx, VBO_BUF_ID + 1);
+ bool success = _mesa_bufferobj_data(ctx,
+ GL_ELEMENT_ARRAY_BUFFER_ARB,
+ MAX2(total_bytes_needed, VBO_SAVE_BUFFER_SIZE),
+ NULL,
+ GL_STATIC_DRAW_ARB, GL_MAP_WRITE_BIT |
+ MESA_GALLIUM_VERTEX_STATE_STORAGE,
+ save->current_bo);
if (!success) {
_mesa_reference_buffer_object(ctx, &save->current_bo, NULL);
_mesa_error(ctx, GL_OUT_OF_MEMORY, "IB allocation");
_mesa_reference_buffer_object(ctx, &node->cold->ib.obj, save->current_bo);
/* Upload the vertices first (see buffer_offset) */
- st_bufferobj_subdata(ctx,
- save->current_bo_bytes_used,
- total_vert_count * save->vertex_size * sizeof(fi_type),
- vertex_to_index ? temp_vertices_buffer : save->vertex_store->buffer_in_ram,
- node->cold->ib.obj);
+ _mesa_bufferobj_subdata(ctx,
+ save->current_bo_bytes_used,
+ total_vert_count * save->vertex_size * sizeof(fi_type),
+ vertex_to_index ? temp_vertices_buffer : save->vertex_store->buffer_in_ram,
+ node->cold->ib.obj);
save->current_bo_bytes_used += total_vert_count * save->vertex_size * sizeof(fi_type);
if (vertex_to_index) {
/* Then upload the indices. */
if (node->cold->ib.obj) {
- st_bufferobj_subdata(ctx,
- save->current_bo_bytes_used,
- idx * sizeof(uint32_t),
- indices,
- node->cold->ib.obj);
+ _mesa_bufferobj_subdata(ctx,
+ save->current_bo_bytes_used,
+ idx * sizeof(uint32_t),
+ indices,
+ node->cold->ib.obj);
save->current_bo_bytes_used += idx * sizeof(uint32_t);
} else {
node->cold->vertex_count = 0;
node->draw_begins = node->cold->prims[0].begin;
if (!save->current_bo) {
- save->current_bo = _mesa_internal_buffer_object_alloc(ctx, VBO_BUF_ID + 1);
- bool success = st_bufferobj_data(ctx,
- GL_ELEMENT_ARRAY_BUFFER_ARB,
- VBO_SAVE_BUFFER_SIZE,
- NULL,
- GL_STATIC_DRAW_ARB, GL_MAP_WRITE_BIT |
- MESA_GALLIUM_VERTEX_STATE_STORAGE,
- save->current_bo);
+ save->current_bo = _mesa_bufferobj_alloc(ctx, VBO_BUF_ID + 1);
+ bool success = _mesa_bufferobj_data(ctx,
+ GL_ELEMENT_ARRAY_BUFFER_ARB,
+ VBO_SAVE_BUFFER_SIZE,
+ NULL,
+ GL_STATIC_DRAW_ARB, GL_MAP_WRITE_BIT |
+ MESA_GALLIUM_VERTEX_STATE_STORAGE,
+ save->current_bo);
if (!success)
save->out_of_memory = true;
}
#include "vbo_private.h"
-#include "state_tracker/st_cb_bufferobjects.h"
-
static void
copy_vao(struct gl_context *ctx, const struct gl_vertex_array_object *vao,
GLbitfield mask, GLbitfield state, GLbitfield pop_state,
const struct vbo_save_vertex_list *list)
{
struct gl_buffer_object *bo = list->cold->VAO[0]->BufferBinding[0].BufferObj;
- void *buffer = st_bufferobj_map_range(ctx, 0, bo->Size, GL_MAP_READ_BIT, /* ? */
- bo, MAP_INTERNAL);
+ void *buffer = _mesa_bufferobj_map_range(ctx, 0, bo->Size, GL_MAP_READ_BIT, /* ? */
+ bo, MAP_INTERNAL);
/* TODO: in this case, we shouldn't create a bo at all and instead keep
* the in-RAM buffer. */
_vbo_loopback_vertex_list(ctx, list, buffer);
- st_bufferobj_unmap(ctx, bo, MAP_INTERNAL);
+ _mesa_bufferobj_unmap(ctx, bo, MAP_INTERNAL);
}