15 #include <vsg/core/Version.h>
23 #if VSG_MAX_DEVICES <= 1
31 T& operator[](uint32_t) {
return value; }
32 const T& operator[](uint32_t)
const {
return value; }
34 uint32_t size()
const {
return 1; }
36 void clear() { value = {}; }
38 auto begin() {
return &value; }
39 auto begin()
const {
return &value; }
41 auto end() {
return &value + 1; }
42 auto end()
const {
return &value + 1; }
45 #elif VSG_MAX_DEVICES <= 4
51 std::array<T, VSG_MAX_DEVICES> buffer;
53 T& operator[](uint32_t deviceID) {
return buffer[deviceID]; }
54 const T& operator[](uint32_t deviceID)
const {
return buffer[deviceID]; }
56 uint32_t size()
const {
return VSG_MAX_DEVICES; }
60 for (
auto& value : buffer) value = {};
63 auto begin() {
return buffer.begin(); }
64 auto begin()
const {
return buffer.begin(); }
66 auto end() {
return buffer.end(); }
67 auto end()
const {
return buffer.end(); }
76 std::vector<T> buffer;
78 T& operator[](uint32_t deviceID)
80 if (deviceID >= buffer.size()) buffer.resize(deviceID + 1);
81 return buffer[deviceID];
84 const T& operator[](uint32_t deviceID)
const
86 return buffer[deviceID];
89 uint32_t size()
const {
return static_cast<uint32_t
>(buffer.size()); }
91 void clear() { buffer.clear(); }
93 auto begin() {
return buffer.begin(); }
94 auto begin()
const {
return buffer.begin(); }
96 auto end() {
return buffer.end(); }
97 auto end()
const {
return buffer.end(); }
vk_buffer that manages a single logical device supported.
Definition: vk_buffer.h:28