Browse Source

re-add pipe_surface map/unmap inlines

tags/mesa_20090313
Keith Whitwell 17 years ago
parent
commit
731e7b961c

+ 1
- 1
src/gallium/auxiliary/draw/draw_vs_sse.c View File

#include "tgsi/util/tgsi_parse.h" #include "tgsi/util/tgsi_parse.h"


#define SSE_MAX_VERTICES 4 #define SSE_MAX_VERTICES 4
#define SSE_SWIZZLES 0
#define SSE_SWIZZLES 1


#if SSE_SWIZZLES #if SSE_SWIZZLES
typedef void (XSTDCALL *codegen_function) ( typedef void (XSTDCALL *codegen_function) (

+ 1
- 1
src/gallium/drivers/softpipe/sp_surface.c View File

struct pipe_surface *src, struct pipe_surface *src,
unsigned srcx, unsigned srcy, unsigned width, unsigned height) unsigned srcx, unsigned srcy, unsigned width, unsigned height)
{ {
assert( dst->cpp == src->cpp );
void *dst_map = pipe->screen->surface_map( pipe->screen, void *dst_map = pipe->screen->surface_map( pipe->screen,
dst, dst,
PIPE_BUFFER_USAGE_CPU_WRITE ); PIPE_BUFFER_USAGE_CPU_WRITE );
src, src,
PIPE_BUFFER_USAGE_CPU_READ ); PIPE_BUFFER_USAGE_CPU_READ );


assert( dst->cpp == src->cpp );
assert(src_map && dst_map); assert(src_map && dst_map);


pipe_copy_rect(dst_map, pipe_copy_rect(dst_map,

+ 33
- 0
src/gallium/include/pipe/p_inlines.h View File

#endif #endif




/* XXX: these are a kludge. will fix when all surfaces are views into
* textures, and free-floating winsys surfaces go away.
*/
static INLINE void *
pipe_surface_map( struct pipe_surface *surf, unsigned flags )
{
if (surf->texture) {
struct pipe_screen *screen = surf->texture->screen;
return surf->texture->screen->surface_map( screen, surf, flags );
}
else {
struct pipe_winsys *winsys = surf->winsys;
char *map = (char *)winsys->buffer_map( winsys, surf->buffer, flags );
if (map == NULL)
return NULL;
return (void *)(map + surf->offset);
}
}

static INLINE void
pipe_surface_unmap( struct pipe_surface *surf )
{
if (surf->texture) {
struct pipe_screen *screen = surf->texture->screen;
surf->texture->screen->surface_unmap( screen, surf );
}
else {
struct pipe_winsys *winsys = surf->winsys;
winsys->buffer_unmap( winsys, surf->buffer );
}
}




/** /**
* Set 'ptr' to point to 'surf' and update reference counting. * Set 'ptr' to point to 'surf' and update reference counting.

Loading…
Cancel
Save