[Mesa-dev] [PATCH 12/26] gallium/radeon: check that handle usage doesn't change for a resource
Marek Olšák
maraeo at gmail.com
Wed Mar 2 16:36:21 UTC 2016
From: Marek Olšák <marek.olsak at amd.com>
---
src/gallium/drivers/radeon/r600_pipe_common.h | 1 +
src/gallium/drivers/radeon/r600_texture.c | 3 +++
2 files changed, 4 insertions(+)
diff --git a/src/gallium/drivers/radeon/r600_pipe_common.h b/src/gallium/drivers/radeon/r600_pipe_common.h
index 4cef5ef..3bbbfbb 100644
--- a/src/gallium/drivers/radeon/r600_pipe_common.h
+++ b/src/gallium/drivers/radeon/r600_pipe_common.h
@@ -169,6 +169,7 @@ struct r600_resource {
/* Whether the resource has been exported via resource_get_handle. */
bool is_shared;
+ unsigned external_usage; /* PIPE_HANDLE_USAGE_* */
};
struct r600_transfer {
diff --git a/src/gallium/drivers/radeon/r600_texture.c b/src/gallium/drivers/radeon/r600_texture.c
index 558dc73..5f49dd7 100644
--- a/src/gallium/drivers/radeon/r600_texture.c
+++ b/src/gallium/drivers/radeon/r600_texture.c
@@ -261,11 +261,14 @@ static boolean r600_texture_get_handle(struct pipe_screen* screen,
if (!res->is_shared) {
res->is_shared = true;
+ res->external_usage = usage;
if (resource->target != PIPE_BUFFER) {
r600_texture_init_metadata(rtex, &metadata);
rscreen->ws->buffer_set_metadata(res->buf, &metadata);
}
+ } else {
+ assert(res->external_usage == usage);
}
return rscreen->ws->buffer_get_handle(res->buf,
--
2.5.0
More information about the mesa-dev
mailing list