Skip to content
Snippets Groups Projects

Resolve "Pass additional vertex attributes to cube shader"

Merged Ghost User requested to merge 52-pass-additional-vertex-attributes-to-cube-shader into develop
Files
20
+ 7
1
@@ -7,6 +7,8 @@
@@ -7,6 +7,8 @@
#include "Handles.hpp"
#include "Handles.hpp"
#include "BufferManager.hpp"
#include "BufferManager.hpp"
 
#include <vector>
 
namespace vkcv {
namespace vkcv {
template<typename T>
template<typename T>
@@ -36,10 +38,14 @@ namespace vkcv {
@@ -36,10 +38,14 @@ namespace vkcv {
return m_count * sizeof(T);
return m_count * sizeof(T);
}
}
void fill(T* data, size_t count = 0, size_t offset = 0) {
void fill(const T* data, size_t count = 0, size_t offset = 0) {
m_manager->fillBuffer(m_handle, data, count * sizeof(T), offset * sizeof(T));
m_manager->fillBuffer(m_handle, data, count * sizeof(T), offset * sizeof(T));
}
}
 
void fill(const std::vector<T>& vector, size_t offset = 0) {
 
fill( static_cast<const T*>(vector.data()), static_cast<size_t>(vector.size()), offset);
 
}
 
[[nodiscard]]
[[nodiscard]]
T* map(size_t offset = 0, size_t count = 0) {
T* map(size_t offset = 0, size_t count = 0) {
return reinterpret_cast<T*>(m_manager->mapBuffer(m_handle, offset * sizeof(T), count * sizeof(T)));
return reinterpret_cast<T*>(m_manager->mapBuffer(m_handle, offset * sizeof(T), count * sizeof(T)));
Loading