From: Francisco Jerez Date: Fri, 18 Oct 2013 23:25:36 +0000 (-0700) Subject: clover: Add a pixel_size() method to the image class. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=adefa84d66b13a4892bbc544194bacdc410fcc4e;p=mesa.git clover: Add a pixel_size() method to the image class. Tested-by: Tom Stellard --- 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; @@ -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; 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;