summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r600/r600_resource.c
diff options
context:
space:
mode:
authorAdam Rak <[email protected]>2011-11-30 22:20:41 +0100
committerTom Stellard <[email protected]>2012-06-01 11:28:10 -0400
commit6a829a1b724ca0d960decee217d260b4de8a5463 (patch)
tree0bc6a96e7a7151ba50aa391e94ca6f0adfc37376 /src/gallium/drivers/r600/r600_resource.c
parent46a13b3b11d859e131399853c11ae2be0eb02f0a (diff)
r600g: compute support for evergreen
Tom Stellard: - Updated for gallium interface changes - Fixed a few bugs: + Set the loop counter + Calculate the correct number of pipes - Added hooks into the LLVM compiler
Diffstat (limited to 'src/gallium/drivers/r600/r600_resource.c')
-rw-r--r--src/gallium/drivers/r600/r600_resource.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/gallium/drivers/r600/r600_resource.c b/src/gallium/drivers/r600/r600_resource.c
index ef0b4ceffd0..0c14a2dc6bc 100644
--- a/src/gallium/drivers/r600/r600_resource.c
+++ b/src/gallium/drivers/r600/r600_resource.c
@@ -27,7 +27,12 @@ static struct pipe_resource *r600_resource_create(struct pipe_screen *screen,
const struct pipe_resource *templ)
{
if (templ->target == PIPE_BUFFER) {
- return r600_buffer_create(screen, templ);
+ if (templ->bind & PIPE_BIND_GLOBAL) {
+ return r600_compute_global_buffer_create(screen, templ);
+ }
+ else {
+ return r600_buffer_create(screen, templ);
+ }
} else {
return r600_texture_create(screen, templ);
}
@@ -44,12 +49,21 @@ static struct pipe_resource *r600_resource_from_handle(struct pipe_screen * scre
}
}
+void r600_resource_destroy(struct pipe_screen *screen, struct pipe_resource *res)
+{
+ if (res->target == PIPE_BUFFER && (res->bind & PIPE_BIND_GLOBAL)) {
+ r600_compute_global_buffer_destroy(screen, res);
+ } else {
+ u_resource_destroy_vtbl(screen, res);
+ }
+}
+
void r600_init_screen_resource_functions(struct pipe_screen *screen)
{
screen->resource_create = r600_resource_create;
screen->resource_from_handle = r600_resource_from_handle;
screen->resource_get_handle = u_resource_get_handle_vtbl;
- screen->resource_destroy = u_resource_destroy_vtbl;
+ screen->resource_destroy = r600_resource_destroy;
}
void r600_init_context_resource_functions(struct r600_context *r600)