[Mesa-dev] [PATCH RFC] clover: clone pipe-resource if root-buffer already exists

Jan Vesely jan.vesely at rutgers.edu
Thu Mar 2 00:57:05 UTC 2017


Fixes cl-api-enqueue-read_write-buffer on carrizo+topaz machine

Signed-off-by: Jan Vesely <jan.vesely at rutgers.edu>
---
I'm not sure if cloning is the right thigh to do.
Should we copy the pointer and increase ref count instead?

PS: the assert did not trigger despite building mesa with --enable-debug

Jan

 src/gallium/state_trackers/clover/core/resource.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/state_trackers/clover/core/resource.cpp b/src/gallium/state_trackers/clover/core/resource.cpp
index 06fd3f6..71414f4 100644
--- a/src/gallium/state_trackers/clover/core/resource.cpp
+++ b/src/gallium/state_trackers/clover/core/resource.cpp
@@ -172,7 +172,7 @@ root_resource::root_resource(clover::device &dev, memory_obj &obj,
 root_resource::root_resource(clover::device &dev, memory_obj &obj,
                              root_resource &r) :
    resource(dev, obj) {
-   assert(0); // XXX -- resource shared among dev and r.dev
+   pipe = dev.pipe->resource_create(dev.pipe, r.pipe);
 }
 
 root_resource::~root_resource() {
-- 
2.9.3



More information about the mesa-dev mailing list