add concept of offset to instancebuffer offset
This commit is contained in:
committed by
Mathias Agopian
parent
39bf0f0a71
commit
6d0a47b37c
@@ -30,6 +30,7 @@
|
||||
#include <utils/FixedCapacityVector.h>
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
|
||||
namespace filament {
|
||||
|
||||
@@ -54,6 +55,7 @@ public:
|
||||
utils::CString const& getName() const noexcept { return mName; }
|
||||
|
||||
backend::BufferObjectHandle getHandle() const noexcept { return mHandle; }
|
||||
uint32_t getOffset() const noexcept { return mOffset; }
|
||||
|
||||
private:
|
||||
friend class RenderableManager;
|
||||
@@ -62,6 +64,7 @@ private:
|
||||
utils::CString mName;
|
||||
size_t mInstanceCount;
|
||||
backend::BufferObjectHandle mHandle;
|
||||
uint32_t mOffset = 0;
|
||||
};
|
||||
|
||||
FILAMENT_DOWNCAST(InstanceBuffer)
|
||||
|
||||
@@ -810,7 +810,8 @@ void FView::prepare(FEngine& engine, DriverApi& driver, RootArenaScope& rootAren
|
||||
descriptorSet.setBuffer(layout,
|
||||
+PerRenderableBindingPoints::OBJECT_UNIFORMS,
|
||||
instance.buffer ? instance.buffer->getHandle() : mRenderableUbh,
|
||||
0, sizeof(PerRenderableUib));
|
||||
instance.buffer ? instance.buffer->getOffset() : 0,
|
||||
sizeof(PerRenderableUib));
|
||||
|
||||
descriptorSet.setBuffer(layout,
|
||||
+PerRenderableBindingPoints::BONES_UNIFORMS,
|
||||
|
||||
Reference in New Issue
Block a user