clover: Add a pixel_size() method to the image class.
authorFrancisco Jerez <currojerez@riseup.net>
Fri, 18 Oct 2013 23:25:36 +0000 (16:25 -0700)
committerFrancisco Jerez <currojerez@riseup.net>
Mon, 21 Oct 2013 17:47:04 +0000 (10:47 -0700)
Tested-by: Tom Stellard <thomas.stellard@amd.com>
src/gallium/state_trackers/clover/core/memory.cpp
src/gallium/state_trackers/clover/core/memory.hpp

index 1c38597215f996823da553e3013f15c61b116d60..87a9f7a5488b541d1a21b45170748d822b1cf8c9 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "core/memory.hpp"
 #include "core/resource.hpp"
+#include "util/u_format.h"
 
 using namespace clover;
 
@@ -165,6 +166,11 @@ image::depth() const {
    return _depth;
 }
 
+size_t
+image::pixel_size() const {
+   return util_format_get_blocksize(translate_format(_format));
+}
+
 size_t
 image::row_pitch() const {
    return _row_pitch;
index 5b179ac8413e3e8a21a2849785cba66803b091e2..6ccf3da58b52c061dd86865ea2f342b5da8626a5 100644 (file)
@@ -120,6 +120,7 @@ namespace clover {
       size_t width() const;
       size_t height() const;
       size_t depth() const;
+      size_t pixel_size() const;
       size_t row_pitch() const;
       size_t slice_pitch() const;