summaryrefslogtreecommitdiff
path: root/src/mesa/pipe/p_state.h
diff options
context:
space:
mode:
authorBrian <brian@i915.localnet.net>2007-07-31 17:42:03 -0600
committerBrian <brian@i915.localnet.net>2007-07-31 17:42:03 -0600
commit20adf45c23dd9ec86a1439ad87c1473395bbb1a7 (patch)
treeeee17a4b7b1572651c2b20661b26b82def9cdd34 /src/mesa/pipe/p_state.h
parent2f245bce420c7a6c6928c4927d0f9a5701cde17f (diff)
Redesign pipe_surface in terms of pipe_region.
struct pipe_buffer goes away. Added basic region functions to softpipe to allocate/release malloc'd regions. Surface-related code is fairly coherent now.
Diffstat (limited to 'src/mesa/pipe/p_state.h')
-rw-r--r--src/mesa/pipe/p_state.h53
1 files changed, 17 insertions, 36 deletions
diff --git a/src/mesa/pipe/p_state.h b/src/mesa/pipe/p_state.h
index d81c3f1778..0767fc2fcb 100644
--- a/src/mesa/pipe/p_state.h
+++ b/src/mesa/pipe/p_state.h
@@ -233,51 +233,17 @@ struct pipe_sampler_state
/***
- *** Non-state Objects
+ *** Resource Objects
***/
-/**
- * A mappable buffer (vertex data, pixel data, etc)
- * XXX replace with "intel_region".
- */
-struct pipe_buffer
-{
- void (*buffer_data)(struct pipe_buffer *pb, GLuint size, const void *src);
- void (*buffer_sub_data)(struct pipe_buffer *pb, GLuint offset, GLuint size,
- const void *src);
- void *(*map)(struct pipe_buffer *pb, GLuint access_mode);
- void (*unmap)(struct pipe_buffer *pb);
- GLubyte *ptr; /**< address, only valid while mapped */
- GLuint mode; /**< PIPE_MAP_x, only valid while mapped */
-};
-
-
-/**
- * 2D surface.
- * May be a renderbuffer, texture mipmap level, etc.
- */
-struct pipe_surface
-{
- struct pipe_buffer buffer; /**< surfaces can be mapped */
- GLuint format:5; /**< PIPE_FORMAT_x */
- GLuint width, height;
-
- GLint stride, cpp;
- GLubyte *ptr; /**< only valid while mapped, may not equal buffer->ptr */
-
- void *rb; /**< Ptr back to renderbuffer (temporary?) */
-
- void (*resize)(struct pipe_surface *ps, GLuint width, GLuint height);
-};
-
-
struct _DriBufferObject;
struct intel_buffer_object;
struct pipe_region
{
struct _DriBufferObject *buffer; /**< buffer manager's buffer ID */
+
GLuint refcount; /**< Reference count for region */
GLuint cpp; /**< bytes per pixel */
GLuint pitch; /**< in pixels */
@@ -290,6 +256,21 @@ struct pipe_region
struct intel_buffer_object *pbo; /* zero-copy uploads */
};
+
+/**
+ * 2D surface.
+ * May be a renderbuffer, texture mipmap level, etc.
+ */
+struct pipe_surface
+{
+ struct pipe_region *region;
+ GLuint format:5; /**< PIPE_FORMAT_x */
+ GLuint width, height;
+
+ void *rb; /**< Ptr back to renderbuffer (temporary?) */
+};
+
+
/**
* Texture object.
* Mipmap levels, cube faces, 3D slices can be accessed as surfaces.