summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/r300/r300_texture.c
diff options
context:
space:
mode:
authorMarek Olšák <maraeo@gmail.com>2010-12-03 02:48:11 +0100
committerMarek Olšák <maraeo@gmail.com>2010-12-03 04:40:22 +0100
commit3ba8843307a909f35f2a04e6be6dcadd760ad82b (patch)
tree4c69fda7f8962184259483b8b96a85243a84e159 /src/gallium/drivers/r300/r300_texture.c
parent6299f241e9fdd86e705d144a42d9b1979c13f9ad (diff)
r300g: use internal BO handle for add_buffer and write_reloc
Small perf improvement in ipers. radeon_drm_get_cs_handle is exactly what this commit tries to avoid in every write_reloc.
Diffstat (limited to 'src/gallium/drivers/r300/r300_texture.c')
-rw-r--r--src/gallium/drivers/r300/r300_texture.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c
index 4b7b3e0356..70fc5d96d8 100644
--- a/src/gallium/drivers/r300/r300_texture.c
+++ b/src/gallium/drivers/r300/r300_texture.c
@@ -675,7 +675,7 @@ static unsigned r300_texture_is_referenced(struct pipe_context *context,
struct r300_texture *rtex = (struct r300_texture *)texture;
if (r300->rws->cs_is_buffer_referenced(r300->cs,
- rtex->buffer, R300_REF_CS))
+ rtex->cs_buffer, R300_REF_CS))
return PIPE_REFERENCED_FOR_READ | PIPE_REFERENCED_FOR_WRITE;
return PIPE_UNREFERENCED;
@@ -777,6 +777,8 @@ r300_texture_create_object(struct r300_screen *rscreen,
}
}
+ tex->cs_buffer = rws->buffer_get_cs_handle(rws, tex->buffer);
+
rws->buffer_set_tiling(rws, tex->buffer,
tex->desc.microtile, tex->desc.macrotile[0],
tex->desc.stride_in_bytes[0]);
@@ -876,6 +878,7 @@ struct pipe_surface* r300_create_surface(struct pipe_context * ctx,
surface->base.u.tex.last_layer = surf_tmpl->u.tex.last_layer;
surface->buffer = tex->buffer;
+ surface->cs_buffer = tex->cs_buffer;
/* Prefer VRAM if there are multiple domains to choose from. */
surface->domain = tex->domain;