summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2011-09-27 02:04:02 +0200
committerMarek Olšák <[email protected]>2011-09-29 01:09:58 +0200
commit7b42ed6eb508e2f0b89f66f3f985ef1d76a0ef91 (patch)
treebb4da846bc6b214daa78a754d1ea4a318d4c58ec
parentb2e6ca8ec759eadd355d678856a49facf53cbd43 (diff)
r300g: remove useless variables in some structures
-rw-r--r--src/gallium/drivers/r300/r300_context.h5
-rw-r--r--src/gallium/drivers/r300/r300_screen_buffer.c2
-rw-r--r--src/gallium/drivers/r300/r300_texture.c16
-rw-r--r--src/gallium/drivers/r300/r300_texture_desc.c18
4 files changed, 12 insertions, 29 deletions
diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h
index 60cbe1a40f5..8c8c7ce129f 100644
--- a/src/gallium/drivers/r300/r300_context.h
+++ b/src/gallium/drivers/r300/r300_context.h
@@ -357,10 +357,6 @@ struct r300_texture_desc {
* derived from the texture properties. */
unsigned size_in_bytes;
- /* Total size of the buffer backing this texture, in bytes.
- * It must be >= size. */
- unsigned buffer_size_in_bytes;
-
/**
* If non-zero, override the natural texture layout with
* a custom stride (in bytes).
@@ -400,7 +396,6 @@ struct r300_resource
struct pb_buffer *buf;
struct radeon_winsys_cs_handle *cs_buf;
enum radeon_bo_domain domain;
- unsigned buf_size;
/* Constant buffers are in user memory. */
uint8_t *constant_buffer;
diff --git a/src/gallium/drivers/r300/r300_screen_buffer.c b/src/gallium/drivers/r300/r300_screen_buffer.c
index c751a943b96..a8392d2dc52 100644
--- a/src/gallium/drivers/r300/r300_screen_buffer.c
+++ b/src/gallium/drivers/r300/r300_screen_buffer.c
@@ -189,7 +189,6 @@ struct pipe_resource *r300_buffer_create(struct pipe_screen *screen,
rbuf->b.user_ptr = NULL;
rbuf->domain = RADEON_DOMAIN_GTT;
rbuf->buf = NULL;
- rbuf->buf_size = templ->width0;
rbuf->constant_buffer = NULL;
/* Alloc constant buffers in RAM. */
@@ -237,7 +236,6 @@ struct pipe_resource *r300_user_buffer_create(struct pipe_screen *screen,
rbuf->b.user_ptr = ptr;
rbuf->domain = RADEON_DOMAIN_GTT;
rbuf->buf = NULL;
- rbuf->buf_size = size;
rbuf->constant_buffer = NULL;
return &rbuf->b.b.b;
}
diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c
index fc84004fb97..d2b3f3c2e6b 100644
--- a/src/gallium/drivers/r300/r300_texture.c
+++ b/src/gallium/drivers/r300/r300_texture.c
@@ -878,7 +878,6 @@ r300_texture_create_object(struct r300_screen *rscreen,
enum radeon_bo_layout microtile,
enum radeon_bo_layout macrotile,
unsigned stride_in_bytes_override,
- unsigned max_buffer_size,
struct pb_buffer *buffer)
{
struct radeon_winsys *rws = rscreen->rws;
@@ -901,7 +900,7 @@ r300_texture_create_object(struct r300_screen *rscreen,
tex->domain = base->flags & R300_RESOURCE_FLAG_TRANSFER ?
RADEON_DOMAIN_GTT :
RADEON_DOMAIN_VRAM | RADEON_DOMAIN_GTT;
- tex->buf_size = max_buffer_size;
+ tex->buf = buffer;
if (!r300_resource_set_properties(&rscreen->screen, &tex->b.b.b, 0, base)) {
if (buffer)
@@ -911,8 +910,7 @@ r300_texture_create_object(struct r300_screen *rscreen,
}
/* Create the backing buffer if needed. */
- if (!buffer) {
- tex->buf_size = tex->tex.size_in_bytes;
+ if (!tex->buf) {
tex->buf = rws->buffer_create(rws, tex->tex.size_in_bytes, 2048,
base->bind, tex->domain);
@@ -920,8 +918,6 @@ r300_texture_create_object(struct r300_screen *rscreen,
FREE(tex);
return NULL;
}
- } else {
- tex->buf = buffer;
}
tex->cs_buf = rws->buffer_get_cs_handle(tex->buf);
@@ -952,7 +948,7 @@ struct pipe_resource *r300_texture_create(struct pipe_screen *screen,
return (struct pipe_resource*)
r300_texture_create_object(rscreen, base, microtile, macrotile,
- 0, 0, NULL);
+ 0, NULL);
}
struct pipe_resource *r300_texture_from_handle(struct pipe_screen *screen,
@@ -963,7 +959,7 @@ struct pipe_resource *r300_texture_from_handle(struct pipe_screen *screen,
struct r300_screen *rscreen = r300_screen(screen);
struct pb_buffer *buffer;
enum radeon_bo_layout microtile, macrotile;
- unsigned stride, size;
+ unsigned stride;
/* Support only 2D textures without mipmaps */
if ((base->target != PIPE_TEXTURE_2D &&
@@ -973,7 +969,7 @@ struct pipe_resource *r300_texture_from_handle(struct pipe_screen *screen,
return NULL;
}
- buffer = rws->buffer_from_handle(rws, whandle, &stride, &size);
+ buffer = rws->buffer_from_handle(rws, whandle, &stride, NULL);
if (!buffer)
return NULL;
@@ -995,7 +991,7 @@ struct pipe_resource *r300_texture_from_handle(struct pipe_screen *screen,
return (struct pipe_resource*)
r300_texture_create_object(rscreen, base, microtile, macrotile,
- stride, size, buffer);
+ stride, buffer);
}
/* Not required to implement u_resource_vtbl, consider moving to another file:
diff --git a/src/gallium/drivers/r300/r300_texture_desc.c b/src/gallium/drivers/r300/r300_texture_desc.c
index fe4f8dd5679..55e363b892c 100644
--- a/src/gallium/drivers/r300/r300_texture_desc.c
+++ b/src/gallium/drivers/r300/r300_texture_desc.c
@@ -507,29 +507,23 @@ boolean r300_texture_desc_init(struct r300_screen *rscreen,
/* Setup the miptree description. */
r300_setup_miptree(rscreen, tex, TRUE);
- /* If the required buffer size is larger the given max size,
+ /* If the required buffer size is larger than the given max size,
* try again without the alignment for the CBZB clear. */
- if (tex->buf_size && tex->tex.size_in_bytes > tex->buf_size) {
+ if (tex->buf && tex->tex.size_in_bytes > tex->buf->size) {
r300_setup_miptree(rscreen, tex, FALSE);
- }
-
- r300_setup_hyperz_properties(rscreen, tex);
- if (tex->buf_size) {
/* Make sure the buffer we got is large enough. */
- if (tex->tex.size_in_bytes > tex->buf_size) {
+ if (tex->tex.size_in_bytes > tex->buf->size) {
fprintf(stderr, "r300: texture_desc_init: The buffer is not "
"large enough. Got: %i, Need: %i, Info:\n",
- tex->buf_size, tex->tex.size_in_bytes);
+ tex->buf->size, tex->tex.size_in_bytes);
r300_tex_print_info(tex, "texture_desc_init");
return FALSE;
}
-
- tex->tex.buffer_size_in_bytes = tex->buf_size;
- } else {
- tex->tex.buffer_size_in_bytes = tex->tex.size_in_bytes;
}
+ r300_setup_hyperz_properties(rscreen, tex);
+
if (SCREEN_DBG_ON(rscreen, DBG_TEX))
r300_tex_print_info(tex, "texture_desc_init");