diff options
Diffstat (limited to 'src/runtime/dragon/jobs/dragonboundingvolumejobs.cpp')
-rw-r--r-- | src/runtime/dragon/jobs/dragonboundingvolumejobs.cpp | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/runtime/dragon/jobs/dragonboundingvolumejobs.cpp b/src/runtime/dragon/jobs/dragonboundingvolumejobs.cpp index 2e1b321..0106151 100644 --- a/src/runtime/dragon/jobs/dragonboundingvolumejobs.cpp +++ b/src/runtime/dragon/jobs/dragonboundingvolumejobs.cpp @@ -57,9 +57,9 @@ public: const Sphere &result() { return m_volume; } bool apply(const Attribute &positionAttribute, - const Buffer &attributeBuffer, + const LoadedBuffer &attributeBuffer, const Attribute &indexAttribute, - const Buffer &indexBuffer, + const LoadedBuffer &indexBuffer, int drawVertexCount, bool primitiveRestartEnabled, int primitiveRestartIndex) @@ -181,7 +181,7 @@ LocalBoundingVolumes calculateLocalBoundingVolumes(LocalBoundingVolumes localBou const ValueContainer<Attribute> &attributes, const ValueContainer<GeometryRenderer> &geometryRenderers, const ValueContainer<Geometry> &geometries, - const ValueContainer<Buffer> &buffers) + const ValueContainer<LoadedBuffer> &buffers) { localBoundingVolumes.reset(); @@ -195,7 +195,8 @@ LocalBoundingVolumes calculateLocalBoundingVolumes(LocalBoundingVolumes localBou // TODO consider using an Optional here LocalBoundingVolumeResult result = *localBoundingVolumes[id]; - bool entityDirty = entities.dirtyOrNew().contains(id); + bool entityDirty = entities.changes().contains(Change{Change::Action::Created, id}) || + entities.changes().contains(Change{Change::Action::Modified, id}); if (entityDirty) { // TODO make all these asserts part of the [] operator Q_ASSERT(entities.contains(id)); @@ -205,7 +206,7 @@ LocalBoundingVolumes calculateLocalBoundingVolumes(LocalBoundingVolumes localBou result.geometryRendererId = entity->m_geometryRendererComponent; } - if (!entity->m_enabled) + if (!entity->isEnabled()) return result; if (result.geometryRendererId.isNull()) @@ -213,7 +214,7 @@ LocalBoundingVolumes calculateLocalBoundingVolumes(LocalBoundingVolumes localBou // Geometry renderer is dirty if the entity is new, or if the geometry renderer itself changed // TODO repeated pattern - can we generalize this somehow? - bool geometryRendererDirty = entityDirty || geometryRenderers.dirtyOrNew().contains(result.geometryRendererId); + bool geometryRendererDirty = entityDirty || geometryRenderers.hasDirtyOrCreated(result.geometryRendererId); if (geometryRendererDirty) { Q_ASSERT(geometryRenderers.contains(result.geometryRendererId)); const auto &geometryRenderer = geometryRenderers[result.geometryRendererId]; @@ -229,7 +230,7 @@ LocalBoundingVolumes calculateLocalBoundingVolumes(LocalBoundingVolumes localBou return result; // TODO what if we have a geometry factory? - bool geometryDirty = geometryRendererDirty || geometries.dirtyOrNew().contains(result.geometryId); + bool geometryDirty = geometryRendererDirty || geometries.hasDirtyOrCreated(result.geometryId); if (geometryDirty) { result.positionAttributeId = QNodeId(); // Reset the ID in case it was set previously result.indexAttributeId = QNodeId(); @@ -269,7 +270,7 @@ LocalBoundingVolumes calculateLocalBoundingVolumes(LocalBoundingVolumes localBou return result; } - bool positionAttributeDirty = geometryDirty || attributes.dirtyOrNew().contains(result.positionAttributeId); + bool positionAttributeDirty = geometryDirty || attributes.hasDirtyOrCreated(result.positionAttributeId); if (positionAttributeDirty) { Q_ASSERT(attributes.contains(result.positionAttributeId)); result.positionAttribute = attributes[result.positionAttributeId]; @@ -288,7 +289,7 @@ LocalBoundingVolumes calculateLocalBoundingVolumes(LocalBoundingVolumes localBou return result; } - bool indexAttributeDirty = geometryDirty || attributes.dirtyOrNew().contains(result.indexAttributeId); + bool indexAttributeDirty = geometryDirty || attributes.hasDirtyOrCreated(result.indexAttributeId); if (indexAttributeDirty) { Q_ASSERT(attributes.contains(result.indexAttributeId)); result.indexAttribute = attributes[result.indexAttributeId]; @@ -310,12 +311,12 @@ LocalBoundingVolumes calculateLocalBoundingVolumes(LocalBoundingVolumes localBou return 0; }(); - bool indexBufferDirty = indexAttributeDirty || buffers.dirtyOrNew().contains(result.indexBufferId); + bool indexBufferDirty = indexAttributeDirty || buffers.hasDirtyOrCreated(result.indexBufferId); if (indexBufferDirty) { result.indexBuffer = buffers[result.indexBufferId]; } - bool positionBufferDirty = positionAttributeDirty || buffers.dirtyOrNew().contains(result.positionBufferId); + bool positionBufferDirty = positionAttributeDirty || buffers.hasDirtyOrCreated(result.positionBufferId); if (indexBufferDirty) { result.positionBuffer = buffers[result.positionBufferId]; } |