[Mesa-dev] [PATCH] clover: change image class to inherit from buffer

Dmitry Cherkassov dcherkassov at gmail.com
Sat Apr 6 13:35:08 PDT 2013


image2d is dynamic_cast-ed down from buffer, but is not it's
direct subclass. Make it inhernit buffer.

Signed-off-by: Dmitry Cherkassov <dcherkassov at gmail.com>
---
 src/gallium/state_trackers/clover/core/memory.cpp |    4 ++--
 src/gallium/state_trackers/clover/core/memory.hpp |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/gallium/state_trackers/clover/core/memory.cpp b/src/gallium/state_trackers/clover/core/memory.cpp
index 8d8be2e..cb64dc1 100644
--- a/src/gallium/state_trackers/clover/core/memory.cpp
+++ b/src/gallium/state_trackers/clover/core/memory.cpp
@@ -119,7 +119,7 @@ image::image(clover::context &ctx, cl_mem_flags flags,
              size_t width, size_t height, size_t depth,
              size_t row_pitch, size_t slice_pitch, size_t size,
              void *host_ptr) :
-   memory_obj(ctx, flags, size, host_ptr),
+   buffer(ctx, flags, size, host_ptr),
    __format(*format), __width(width), __height(height), __depth(depth),
    __row_pitch(row_pitch), __slice_pitch(slice_pitch) {
 }
@@ -174,7 +174,7 @@ image2d::image2d(clover::context &ctx, cl_mem_flags flags,
                  const cl_image_format *format, size_t width,
                  size_t height, size_t row_pitch,
                  void *host_ptr) :
-   image(ctx, flags, format, width, height, 0,
+   image(ctx, flags, format, width, height, 1,//
          row_pitch, 0, height * row_pitch, host_ptr) {
 }
 
diff --git a/src/gallium/state_trackers/clover/core/memory.hpp b/src/gallium/state_trackers/clover/core/memory.hpp
index 96f70e9..4cb58c4 100644
--- a/src/gallium/state_trackers/clover/core/memory.hpp
+++ b/src/gallium/state_trackers/clover/core/memory.hpp
@@ -104,7 +104,7 @@ namespace clover {
                std::unique_ptr<clover::sub_resource>> resources;
    };
 
-   struct image : public memory_obj {
+   struct image : public buffer {
    protected:
       image(clover::context &ctx, cl_mem_flags flags,
             const cl_image_format *format,
-- 
1.7.10.4



More information about the mesa-dev mailing list