/* Grabs the hardware lock!
*/
-static void intel_buffer_data(struct pipe_winsys *winsys,
- struct pipe_buffer_handle *buf,
- unsigned size, const void *data,
- unsigned usage )
+static int intel_buffer_data(struct pipe_winsys *winsys,
+ struct pipe_buffer_handle *buf,
+ unsigned size, const void *data,
+ unsigned usage )
{
driBOData( dri_bo(buf), size, data, 0 );
+ return 0;
}
-static void intel_buffer_subdata(struct pipe_winsys *winsys,
- struct pipe_buffer_handle *buf,
- unsigned long offset,
- unsigned long size,
- const void *data)
+static int intel_buffer_subdata(struct pipe_winsys *winsys,
+ struct pipe_buffer_handle *buf,
+ unsigned long offset,
+ unsigned long size,
+ const void *data)
{
driBOSubData( dri_bo(buf), offset, size, data );
+ return 0;
}
-static void intel_buffer_get_subdata(struct pipe_winsys *winsys,
- struct pipe_buffer_handle *buf,
- unsigned long offset,
- unsigned long size,
- void *data)
+static int intel_buffer_get_subdata(struct pipe_winsys *winsys,
+ struct pipe_buffer_handle *buf,
+ unsigned long offset,
+ unsigned long size,
+ void *data)
{
driBOGetSubData( dri_bo(buf), offset, size, data );
+ return 0;
}
/* Pipe has no concept of pools. We choose the tex/region pool
* for all buffers.
*/
static struct pipe_buffer_handle *
-intel_buffer_create(struct pipe_winsys *winsys, unsigned flags)
+intel_buffer_create(struct pipe_winsys *winsys,
+ unsigned alignment,
+ unsigned flags,
+ unsigned hint )
{
struct _DriBufferObject *buffer;
struct intel_pipe_winsys *iws = intel_pipe_winsys(winsys);
driGenBuffers( iws->regionPool,
- "pipe buffer", 1, &buffer, 64, 0, 0 );
+ "pipe buffer", 1, &buffer, alignment, flags, hint );
return pipe_bo(buffer);
}
static struct pipe_buffer_handle *
-xm_buffer_create(struct pipe_winsys *pws, unsigned alignment)
+xm_buffer_create(struct pipe_winsys *pws,
+ unsigned alignment,
+ unsigned flags,
+ unsigned hint)
{
struct xm_buffer *buffer = CALLOC_STRUCT(xm_buffer);
buffer->refcount = 1;
assert(region->pitch > 0);
- region->buffer = winsys->buffer_create( winsys, alignment )
+ region->buffer = winsys->buffer_create( winsys, alignment, 0, 0 )
;
/* NULL data --> just allocate the space */
break;
case PIPE_FORMAT_A8R8G8B8_UNORM:
- case PIPE_FORMAT_U_A8_R8_G8_B8:
case PIPE_FORMAT_R8G8B8A8_UNORM:
attrib[0] = (float) ((unsigned char *) ptr)[2] / 255.0f;
attrib[1] = (float) ((unsigned char *) ptr)[1] / 255.0f;
if (i915->flags.is_i945 ? i945_miptree_layout(pipe, tex) :
i915_miptree_layout(pipe, tex)) {
tex->buffer = pipe->winsys->buffer_create(pipe->winsys,
- PIPE_SURFACE_FLAG_TEXTURE);
+ PIPE_SURFACE_FLAG_TEXTURE,
+ 0, 0);
if (tex->buffer)
pipe->winsys->buffer_data(pipe->winsys, tex->buffer,
if (softpipe_mipmap_tree_layout(pipe, spt)) {
spt->buffer = pipe->winsys->buffer_create(pipe->winsys,
- PIPE_SURFACE_FLAG_TEXTURE);
+ 32,
+ PIPE_SURFACE_FLAG_TEXTURE,
+ 0);
if (spt->buffer) {
pipe->winsys->buffer_data(pipe->winsys, spt->buffer,
}
}
-static void
+static int
xm_buffer_data(struct pipe_winsys *pws, struct pipe_buffer_handle *buf,
unsigned size, const void *data, unsigned usage )
{
}
if (data)
memcpy(xm_buf->data, data, size);
+ return 0;
}
-static void
+static int
xm_buffer_subdata(struct pipe_winsys *pws, struct pipe_buffer_handle *buf,
unsigned long offset, unsigned long size, const void *data)
{
assert(!xm_buf->userBuffer);
assert(b);
memcpy(b + offset, data, size);
+ return 0;
}
-static void
+static int
xm_buffer_get_subdata(struct pipe_winsys *pws, struct pipe_buffer_handle *buf,
unsigned long offset, unsigned long size, void *data)
{
assert(!xm_buf->userBuffer);
assert(b);
memcpy(data, b + offset, size);
+ return 0;
}
static struct pipe_buffer_handle *
-xm_buffer_create(struct pipe_winsys *pws, unsigned flags)
+xm_buffer_create(struct pipe_winsys *pws,
+ unsigned alignment,
+ unsigned flags,
+ unsigned hints)
{
struct xm_buffer *buffer = CALLOC_STRUCT(xm_buffer);
buffer->refcount = 1;
pipe->winsys->buffer_reference(pipe->winsys, &strb->surface->buffer,
NULL);
- strb->surface->buffer = pipe->winsys->buffer_create(pipe->winsys, flags);
+ strb->surface->buffer = pipe->winsys->buffer_create(pipe->winsys, 32, flags, 0);
if (!strb->surface->buffer)
return GL_FALSE; /* out of memory, try s/w buffer? */