| 101 | |
| 102 | template <typename T> |
| 103 | Status Texture2D::ReadData(CLCommandQueue* queue, |
| 104 | std::vector<T>* result) const { |
| 105 | const int element_size = ChannelTypeToSizeInBytes(channel_type_); |
| 106 | if (sizeof(T) != element_size) { |
| 107 | return InvalidArgumentError("Pixel format is different."); |
| 108 | } |
| 109 | |
| 110 | const int elements_count = width_ * height_ * 4; |
| 111 | result->resize(elements_count); |
| 112 | |
| 113 | return queue->EnqueueReadImage(texture_, int3(width_, height_, 1), |
| 114 | result->data()); |
| 115 | } |
| 116 | |
| 117 | } // namespace cl |
| 118 | } // namespace gpu |
nothing calls this directly
no test coverage detected