Lines Matching +full:is +full:- +full:buffer
7 // http://www.apache.org/licenses/LICENSE-2.0
10 // distributed under the License is distributed on an "AS IS" BASIS,
36 /// Unknown buffer type
37 kUnknown = -1,
38 /// A color buffer.
40 /// A depth/stencil buffer.
42 /// An index buffer.
48 /// A storage buffer.
50 /// A dynamic storage buffer.
52 /// A uniform buffer.
54 /// A dynamic uniform buffer.
56 /// A push constant buffer.
58 /// A vertex buffer.
62 /// A uniform texel buffer.
64 /// A storage texel buffer.
75 /// A buffer stores data. The buffer maybe provided from the input script, or
76 /// maybe created as needed. A buffer must have a unique name.
77 class Buffer {
79 /// Create a buffer of unknown type.
80 Buffer();
82 ~Buffer();
84 /// Sets the Format of the buffer to |format|.
89 /// Returns the Format describing the buffer data.
92 /// Sets the sampler used with buffer of combined image sampler type.
94 /// Returns the sampler of combined image sampler buffer.
100 /// Sets the buffer |name|.
102 /// Returns the name of the buffer.
105 /// Gets the number of elements this buffer is wide.
107 /// Set the number of elements wide for the buffer.
109 /// Get the number of elements this buffer is high.
111 /// Set the number of elements high for the buffer.
113 /// Get the number of elements this buffer is deep.
115 /// Set the number of elements this buffer is deep.
123 // | ---------- Element ---------- | ElementCount == 1
127 // the format is std140 and there are 3 rows, the SizeInBytes will be
130 /// Sets the number of elements in the buffer.
132 /// Returns the number of elements in the buffer.
135 /// Sets the number of values in the buffer.
141 if (format_->IsPacked()) { in SetValueCount()
148 element_count_ = count / format_->InputNeededPerElement(); in SetValueCount()
151 /// Returns the number of values in the buffer.
156 if (format_->IsPacked()) in ValueCount()
158 return element_count_ * format_->InputNeededPerElement(); in ValueCount()
161 /// Returns the number of bytes needed for the data in the buffer.
165 return ElementCount() * format_->SizeInBytes(); in GetSizeInBytes()
168 /// Returns the number of bytes for one element in the buffer.
169 uint32_t GetElementStride() { return format_->SizeInBytes(); } in GetElementStride()
171 /// Returns the number of bytes for one row of elements in the buffer.
174 /// Sets the data into the buffer.
177 /// Resizes the buffer to hold |element_count| elements. This is separate
182 /// Resizes the buffer to hold |size_in_bytes|/format_->SizeInBytes()
183 /// number of elements while resizing the buffer to |size_in_bytes| bytes.
184 /// This requires the format to have been set. This is separate from
185 /// SetSizeInElements() since the given argument here is |size_in_bytes|
191 /// Returns max_size_in_bytes_ if it is not zero. Otherwise it means this
192 /// buffer is an amber buffer which has a fix size and returns
196 /// Write |data| into the buffer |offset| bytes from the start. Write
201 /// max_size_in_bytes_ and updates it if underlying buffer got bigger
205 /// Writes |src| data into buffer at |offset|.
206 Result SetDataFromBuffer(const Buffer* src, uint32_t offset);
208 /// Sets the number of mip levels for a buffer used as a color buffer
221 /// Returns a pointer to the internal storage of the buffer.
223 /// Returns a pointer to the internal storage of the buffer.
226 /// Returns a casted pointer to the internal storage of the buffer.
232 /// Copies the buffer values to an other one
233 Result CopyTo(Buffer* buffer) const;
235 /// Succeeds only if both buffer contents are equal
236 Result IsEqual(Buffer* buffer) const;
243 Result CheckCompability(Buffer* buffer) const;
245 /// Compare the RMSE of this buffer against |buffer|. The RMSE must be
247 Result CompareRMSE(Buffer* buffer, float tolerance) const;
249 /// Compare the histogram EMD of this buffer against |buffer|. The EMD must be
251 Result CompareHistogramEMD(Buffer* buffer, float tolerance) const;
259 // Calculates the difference between the value stored in this buffer and
260 // those stored in |buffer| and returns all the values.
261 std::vector<double> CalculateDiffs(const Buffer* buffer) const;
264 /// max_size_in_bytes_ is the total size in bytes needed to hold the buffer