Fixing flicking in instance based objects

This commit is contained in:
Brad Davis 2016-08-01 09:15:17 -07:00
parent adcfd55cc0
commit 894d29bb29
2 changed files with 19 additions and 0 deletions

View file

@ -26,6 +26,21 @@ Frame::~Frame() {
void Frame::finish() {
std::unordered_set<Buffer*> seenBuffers;
for (Batch& batch : batches) {
for (auto& namedCallData : batch._namedData) {
for (auto& buffer : namedCallData.second.buffers) {
if (!buffer) {
continue;
}
if (!buffer->isDirty()) {
continue;
}
if (seenBuffers.count(buffer.get())) {
continue;
}
seenBuffers.insert(buffer.get());
bufferUpdates.push_back({ buffer, buffer->getUpdate() });
}
}
for (auto& bufferCacheItem : batch._buffers._items) {
const BufferPointer& buffer = bufferCacheItem._data;
if (!buffer) {

View file

@ -372,11 +372,15 @@ void GeometryCache::buildShapes() {
extrudePolygon<6>(_shapes[Hexagon], _shapeVertices, _shapeIndices);
//Octagon,
extrudePolygon<8>(_shapes[Octagon], _shapeVertices, _shapeIndices);
//Quad,
//Circle,
//Torus,
//Cone,
//Cylinder,
_shapeIndices->flush();
_shapeVertices->flush();
}
gpu::Stream::FormatPointer& getSolidStreamFormat() {