diff options
author | Francisco Jerez <[email protected]> | 2013-10-18 16:25:36 -0700 |
---|---|---|
committer | Francisco Jerez <[email protected]> | 2013-10-21 10:47:04 -0700 |
commit | adefa84d66b13a4892bbc544194bacdc410fcc4e (patch) | |
tree | 492df60e420f9a281dc39774a9350db0e87ef55c /src/gallium/state_trackers | |
parent | 6230f77232a4703c9f98f569104ac03430a5fb95 (diff) |
clover: Add a pixel_size() method to the image class.
Tested-by: Tom Stellard <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r-- | src/gallium/state_trackers/clover/core/memory.cpp | 6 | ||||
-rw-r--r-- | src/gallium/state_trackers/clover/core/memory.hpp | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/clover/core/memory.cpp b/src/gallium/state_trackers/clover/core/memory.cpp index 1c38597215f..87a9f7a5488 100644 --- a/src/gallium/state_trackers/clover/core/memory.cpp +++ b/src/gallium/state_trackers/clover/core/memory.cpp @@ -22,6 +22,7 @@ #include "core/memory.hpp" #include "core/resource.hpp" +#include "util/u_format.h" using namespace clover; @@ -166,6 +167,11 @@ image::depth() const { } size_t +image::pixel_size() const { + return util_format_get_blocksize(translate_format(_format)); +} + +size_t image::row_pitch() const { return _row_pitch; } diff --git a/src/gallium/state_trackers/clover/core/memory.hpp b/src/gallium/state_trackers/clover/core/memory.hpp index 5b179ac8413..6ccf3da58b5 100644 --- a/src/gallium/state_trackers/clover/core/memory.hpp +++ b/src/gallium/state_trackers/clover/core/memory.hpp @@ -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; |