19 ShaderBuffer(
const std::string &name, uint64_t size, UsageHint usage_hint) :
21 _data_size_bytes(size),
22 _usage_hint(usage_hint) {
30 ShaderBuffer(
const std::string &name, vector_uchar initial_data, UsageHint usage_hint) :
32 _data_size_bytes(initial_data.size()),
33 _usage_hint(usage_hint),
34 _initial_data(std::move(initial_data)) {
37 if ((_initial_data.size() & 15u) != 0) {
38 _initial_data.resize((_initial_data.size() + 15u) & ~15u, 0);
39 _data_size_bytes = _initial_data.size();
46 INLINE uint64_t ShaderBuffer::
47 get_data_size_bytes()
const {
48 return _data_size_bytes;
54 INLINE GeomEnums::UsageHint ShaderBuffer::
55 get_usage_hint()
const {
64 if (_initial_data.empty()) {
67 return &_initial_data[0];
A base class for all things which can have a name.
const unsigned char * get_initial_data() const
Returns a pointer to the initial buffer data, or NULL if not specified.