summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r300/r300_context.h
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2011-02-10 05:36:44 +0100
committerMarek Olšák <[email protected]>2011-02-10 11:27:35 +0100
commit56ba7e913fef0ea2b1bead582108f9ab3ab8263d (patch)
treef65cb5007441ab0a8fc07e6baa13efc71218acbe /src/gallium/drivers/r300/r300_context.h
parentce9c0d280104c8001a3ee360b07218ad3d260e46 (diff)
r300g: consolidate buffers and textures to r300_resource
Transfers and create/destroy are still handled separately.
Diffstat (limited to 'src/gallium/drivers/r300/r300_context.h')
-rw-r--r--src/gallium/drivers/r300/r300_context.h26
1 files changed, 14 insertions, 12 deletions
diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h
index a9ce7cca58b..e55f138d638 100644
--- a/src/gallium/drivers/r300/r300_context.h
+++ b/src/gallium/drivers/r300/r300_context.h
@@ -323,13 +323,9 @@ struct r300_surface {
/* Whether the CBZB clear is allowed on the surface. */
boolean cbzb_allowed;
-
};
struct r300_texture_desc {
- /* Parent class. */
- struct u_resource b;
-
/* Width, height, and depth.
* Most of the time, these are equal to pipe_texture::width0, height0,
* and depth0. However, NPOT 3D textures must have dimensions aligned
@@ -388,20 +384,26 @@ struct r300_texture_desc {
unsigned zmask_dwords[R300_MAX_TEXTURE_LEVELS];
};
-struct r300_texture {
- struct r300_texture_desc desc;
-
- enum r300_buffer_domain domain;
+struct r300_resource
+{
+ struct u_vbuf_resource b;
- /* Pipe buffer backing this texture. */
+ /* Winsys buffer backing this resource. */
struct r300_winsys_buffer *buf;
struct r300_winsys_cs_buffer *cs_buf;
+ enum r300_buffer_domain domain;
+
+ /* Constant buffers are in user memory. */
+ uint8_t *constant_buffer;
+
+ /* Texture description (addressing, layout, special features). */
+ struct r300_texture_desc tex;
/* Registers carrying texture format data. */
/* Only format-independent bits should be filled in. */
struct r300_texture_format_state tx_format;
- /* hyper-z memory allocs */
+ /* HiZ memory allocations. */
struct mem_block *hiz_mem[R300_MAX_TEXTURE_LEVELS];
boolean hiz_in_use[R300_MAX_TEXTURE_LEVELS];
@@ -611,9 +613,9 @@ static INLINE struct r300_surface* r300_surface(struct pipe_surface* surf)
return (struct r300_surface*)surf;
}
-static INLINE struct r300_texture* r300_texture(struct pipe_resource* tex)
+static INLINE struct r300_resource* r300_resource(struct pipe_resource* tex)
{
- return (struct r300_texture*)tex;
+ return (struct r300_resource*)tex;
}
static INLINE struct r300_context* r300_context(struct pipe_context* context)