#include "p_state.h"
struct pipe_state_cache;
+
+
/**
- * Software pipeline rendering context. Basically a collection of
- * state setting functions, plus VBO drawing entrypoint.
+ * Gallium rendering context. Basically:
+ * - state setting functions
+ * - VBO drawing functions
+ * - surface functions
+ * - device queries
*/
struct pipe_context {
struct pipe_winsys *winsys;
+ void *priv; /** context private data (for DRI for example) */
+
void (*destroy)( struct pipe_context * );
/*
boolean (*is_format_supported)( struct pipe_context *pipe,
uint format );
- void (*max_texture_size)(struct pipe_context *pipe,
- unsigned textureType, /* PIPE_TEXTURE_x */
- unsigned *maxWidth,
- unsigned *maxHeight,
- unsigned *maxDepth);
-
const char *(*get_name)( struct pipe_context *pipe );
const char *(*get_vendor)( struct pipe_context *pipe );
int (*get_param)( struct pipe_context *pipe, int param );
+ float (*get_paramf)( struct pipe_context *pipe, int param );
/*
void (*set_texture_state)( struct pipe_context *,
unsigned unit,
- struct pipe_mipmap_tree * );
+ struct pipe_texture * );
void (*set_viewport_state)( struct pipe_context *,
const struct pipe_viewport_state * );
/** Get a surface which is a "view" into a texture */
struct pipe_surface *(*get_tex_surface)(struct pipe_context *pipe,
- struct pipe_mipmap_tree *texture,
+ struct pipe_texture *texture,
unsigned face, unsigned level,
unsigned zslice);
/*
- * Memory region functions
+ * Surface functions
*/
- ubyte *(*region_map)(struct pipe_context *pipe, struct pipe_region *r);
-
- void (*region_unmap)(struct pipe_context *pipe, struct pipe_region *r);
-
- void (*region_data)(struct pipe_context *pipe,
- struct pipe_region *dest,
- unsigned dest_offset,
- unsigned destx, unsigned desty,
- const void *src, unsigned src_stride,
- unsigned srcx, unsigned srcy,
- unsigned width, unsigned height);
-
- void (*region_copy)(struct pipe_context *pipe,
- struct pipe_region *dest,
- unsigned dest_offset,
- unsigned destx, unsigned desty,
- struct pipe_region *src, /* don't make this const -
- need to map/unmap */
- unsigned src_offset,
- unsigned srcx, unsigned srcy,
- unsigned width, unsigned height);
-
- void (*region_fill)(struct pipe_context *pipe,
- struct pipe_region *dst,
- unsigned dst_offset,
- unsigned dstx, unsigned dsty,
- unsigned width, unsigned height,
- unsigned value);
+ void (*surface_data)(struct pipe_context *pipe,
+ struct pipe_surface *dest,
+ unsigned destx, unsigned desty,
+ const void *src, unsigned src_stride,
+ unsigned srcx, unsigned srcy,
+ unsigned width, unsigned height);
+
+ void (*surface_copy)(struct pipe_context *pipe,
+ struct pipe_surface *dest,
+ unsigned destx, unsigned desty,
+ struct pipe_surface *src, /* don't make this const -
+ need to map/unmap */
+ unsigned srcx, unsigned srcy,
+ unsigned width, unsigned height);
+
+ void (*surface_fill)(struct pipe_context *pipe,
+ struct pipe_surface *dst,
+ unsigned dstx, unsigned dsty,
+ unsigned width, unsigned height,
+ unsigned value);
/*
* Texture functions
*/
- boolean (*mipmap_tree_layout)( struct pipe_context *pipe,
- struct pipe_mipmap_tree *mt );
+ void (*texture_create)(struct pipe_context *pipe,
+ struct pipe_texture **pt);
+
+ void (*texture_release)(struct pipe_context *pipe,
+ struct pipe_texture **pt);
/* Flush rendering: