diff --git a/android/gltfio-android/src/main/java/com/google/android/filament/gltfio/AssetLoader.java b/android/gltfio-android/src/main/java/com/google/android/filament/gltfio/AssetLoader.java index 6da106fc39..ba357257b3 100644 --- a/android/gltfio-android/src/main/java/com/google/android/filament/gltfio/AssetLoader.java +++ b/android/gltfio-android/src/main/java/com/google/android/filament/gltfio/AssetLoader.java @@ -129,12 +129,12 @@ public class AssetLoader { } /** - * Consumes the contents of a glTF 2.0 file and produces a master asset with one or more + * Consumes the contents of a glTF 2.0 file and produces a primary asset with one or more * instances. * * The given instance array must be sized to the desired number of instances. If successful, - * this method will populate the array with slave instances whose resources are shared with - * the master asset. + * this method will populate the array with secondary instances whose resources are shared with + * the primary asset. */ @Nullable @SuppressWarnings("unused") diff --git a/filament/backend/src/opengl/OpenGLContext.h b/filament/backend/src/opengl/OpenGLContext.h index 741eb14e03..2c6321e3ac 100644 --- a/filament/backend/src/opengl/OpenGLContext.h +++ b/filament/backend/src/opengl/OpenGLContext.h @@ -376,7 +376,7 @@ void OpenGLContext::bindVertexArray(RenderPrimitive const* p) noexcept { void OpenGLContext::bindBufferRange(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size) noexcept { size_t targetIndex = getIndexForBufferTarget(target); - assert(targetIndex <= 1); // sanity check + assert(targetIndex <= 1); // validity check // this ALSO sets the generic binding if ( state.buffers.targets[targetIndex].buffers[index].name != buffer diff --git a/filament/src/Renderer.cpp b/filament/src/Renderer.cpp index 339f706a7b..b3ce3f155d 100644 --- a/filament/src/Renderer.cpp +++ b/filament/src/Renderer.cpp @@ -170,8 +170,8 @@ void FRenderer::render(FView const* view) { FEngine& engine = mEngine; JobSystem& js = engine.getJobSystem(); - // create a master job so no other job can escape - auto masterJob = js.setMasterJob(js.createJob()); + // create a root job so no other job can escape + auto rootJob = js.setRootJob(js.createJob()); // execute the render pass renderJob(rootArena, const_cast(*view)); @@ -180,7 +180,7 @@ void FRenderer::render(FView const* view) { engine.flush(); // and wait for all jobs to finish as a safety (this should be a no-op) - js.runAndWait(masterJob); + js.runAndWait(rootJob); } } diff --git a/libs/gltfio/include/gltfio/AssetLoader.h b/libs/gltfio/include/gltfio/AssetLoader.h index c14864eff5..a276ef5a95 100644 --- a/libs/gltfio/include/gltfio/AssetLoader.h +++ b/libs/gltfio/include/gltfio/AssetLoader.h @@ -153,27 +153,27 @@ public: FilamentAsset* createAssetFromBinary(const uint8_t* bytes, uint32_t nbytes); /** - * Consumes the contents of a glTF 2.0 file and produces a master asset with one or more + * Consumes the contents of a glTF 2.0 file and produces a primary asset with one or more * instances. * * The returned instances share their textures, material instances, and vertex buffers with the - * master asset. However each instance has its own unique set of entities, transform components, - * and renderable components. Instances are automatically freed when the master asset is freed. + * primary asset. However each instance has its own unique set of entities, transform components, + * and renderable components. Instances are automatically freed when the primary asset is freed. * - * Light components are not instanced, they belong only to the master asset. + * Light components are not instanced, they belong only to the primary asset. * - * Clients must use ResourceLoader to load resources on the master asset. + * Clients must use ResourceLoader to load resources on the primary asset. * * The entity accessors and renderable stack in the returned FilamentAsset represent the union * of all entities across all instances. Use the individual FilamentInstance objects to access - * each partition of entities. Similarly, the Animator in the master asset controls all + * each partition of entities. Similarly, the Animator in the primary asset controls all * instances. To animate instances individually, use FilamentInstance::getAnimator(). * * @param bytes the contents of a glTF 2.0 file (JSON or GLB) * @param numBytes the number of bytes in "bytes" * @param instances destination pointer, to be populated by the requested number of instances * @param numInstances requested number of instances - * @return the master asset that has ownership over all instances + * @return the primary asset that has ownership over all instances */ FilamentAsset* createInstancedAsset(const uint8_t* bytes, uint32_t numBytes, FilamentInstance** instances, size_t numInstances); diff --git a/libs/gltfio/include/gltfio/FilamentAsset.h b/libs/gltfio/include/gltfio/FilamentAsset.h index 6282a5cbec..3aea411af5 100644 --- a/libs/gltfio/include/gltfio/FilamentAsset.h +++ b/libs/gltfio/include/gltfio/FilamentAsset.h @@ -194,7 +194,7 @@ public: * * The animator is owned by the asset and should not be manually deleted. * The first time this is called, it must be called before FilamentAsset::releaseSourceData(). - * If the asset is instanced, this returns a "master" animator that controls all instances. + * If the asset is instanced, this returns a "primary" animator that controls all instances. * To animate each instance individually, use \see FilamentInstance. */ Animator* getAnimator() noexcept; diff --git a/libs/gltfio/src/AssetLoader.cpp b/libs/gltfio/src/AssetLoader.cpp index 953084aa01..960619bb79 100644 --- a/libs/gltfio/src/AssetLoader.cpp +++ b/libs/gltfio/src/AssetLoader.cpp @@ -284,7 +284,7 @@ void FAssetLoader::createAsset(const cgltf_data* srcAsset, size_t numInstances) // buffers and index buffers) and mMatInstanceCache (materials and textures) help avoid // needless duplication of resources. for (size_t index = 0; index < numInstances; ++index) { - // Create a root node within each instance that is a child of the master root. + // Create a root node within each instance that is a child of the primary root. auto rootTransform = mTransformManager.getInstance(mResult->mRoot); Entity instanceRoot = mEntityManager.create(); mTransformManager.create(instanceRoot, rootTransform); diff --git a/libs/utils/include/utils/JobSystem.h b/libs/utils/include/utils/JobSystem.h index 5e927d8541..a9866cc34c 100644 --- a/libs/utils/include/utils/JobSystem.h +++ b/libs/utils/include/utils/JobSystem.h @@ -90,9 +90,13 @@ public: // If a parent is not specified when creating a job, that job will automatically take the - // master job as a parent. - // The master job is reset when waited on. - Job* setMasterJob(Job* job) noexcept { return mMasterJob = job; } + // root job as a parent. + // The root job is reset when waited on. + Job* setRootJob(Job* job) noexcept { return mRootJob = job; } + + // use setRootJob() instead + UTILS_DEPRECATED + Job* setMasterJob(Job* job) noexcept { return setRootJob(job); } Job* create(Job* parent, JobFunc func) noexcept; @@ -401,7 +405,7 @@ private: Job* const mJobStorageBase; // Base for conversion to indices uint16_t mThreadCount = 0; // total # of threads in the pool uint8_t mParallelSplitCount = 0; // # of split allowable in parallel_for - Job* mMasterJob = nullptr; + Job* mRootJob = nullptr; utils::SpinLock mThreadMapLock; // this should have very little contention tsl::robin_map mThreadMap; diff --git a/libs/utils/src/JobSystem.cpp b/libs/utils/src/JobSystem.cpp index 1dd80e1e74..878e6b4c2d 100644 --- a/libs/utils/src/JobSystem.cpp +++ b/libs/utils/src/JobSystem.cpp @@ -355,7 +355,7 @@ void JobSystem::finish(Job* job) noexcept { JobSystem::Job* JobSystem::create(JobSystem::Job* parent, JobFunc func) noexcept { - parent = (parent == nullptr) ? mMasterJob : parent; + parent = (parent == nullptr) ? mRootJob : parent; Job* const job = allocateJob(); if (UTILS_LIKELY(job)) { size_t index = 0x7FFF; @@ -458,8 +458,8 @@ void JobSystem::waitAndRelease(Job*& job) noexcept { } } while (!hasJobCompleted(job) && !exitRequested()); - if (job == mMasterJob) { - mMasterJob = nullptr; + if (job == mRootJob) { + mRootJob = nullptr; } release(job);