mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 13:12:52 +02:00
Cleaning up a missing constructor and adjusting the stride for the StrucBuffer by default + merging with upstream
This commit is contained in:
parent
eea5118eab
commit
77062ac1b3
3 changed files with 18 additions and 4 deletions
|
@ -384,12 +384,12 @@ public:
|
|||
template <class T> class StructBuffer : public gpu::BufferView {
|
||||
public:
|
||||
|
||||
static BufferPointer makeBuffer() {
|
||||
T t;
|
||||
return std::make_shared<gpu::Buffer>(sizeof(T), (const gpu::Byte*) &t);
|
||||
template <class U> static BufferPointer makeBuffer() {
|
||||
U t;
|
||||
return std::make_shared<gpu::Buffer>(sizeof(U), (const gpu::Byte*) &t, sizeof(U));
|
||||
}
|
||||
~StructBuffer<T>() {};
|
||||
StructBuffer<T>() : gpu::BufferView(makeBuffer()) {}
|
||||
StructBuffer<T>() : gpu::BufferView(makeBuffer<T>()) {}
|
||||
|
||||
|
||||
T& edit() {
|
||||
|
|
|
@ -44,6 +44,17 @@ enum LightClusterGridShader_BufferSlot {
|
|||
LIGHT_CLUSTER_GRID_CLUSTER_CONTENT_SLOT,
|
||||
};
|
||||
|
||||
FrustumGrid::FrustumGrid(const FrustumGrid& source) :
|
||||
frustumNear(source.frustumNear),
|
||||
rangeNear(source.rangeNear),
|
||||
rangeFar(source.rangeFar),
|
||||
frustumFar(source.frustumFar),
|
||||
dims(source.dims),
|
||||
spare(source.spare),
|
||||
eyeToGridProj(source.eyeToGridProj),
|
||||
worldToEyeMat(source.worldToEyeMat),
|
||||
eyeToWorldMat(source.eyeToWorldMat)
|
||||
{}
|
||||
|
||||
void FrustumGrid::generateGridPlanes(Planes& xPlanes, Planes& yPlanes, Planes& zPlanes) {
|
||||
xPlanes.resize(dims.x + 1);
|
||||
|
|
|
@ -33,6 +33,9 @@ public:
|
|||
glm::mat4 worldToEyeMat;
|
||||
glm::mat4 eyeToWorldMat;
|
||||
|
||||
FrustumGrid() = default;
|
||||
FrustumGrid(const FrustumGrid& source);
|
||||
|
||||
void updateFrustum(const ViewFrustum& frustum) {
|
||||
frustumNear = frustum.getNearClip();
|
||||
frustumFar = frustum.getFarClip();
|
||||
|
|
Loading…
Reference in a new issue