diff --git a/filament/backend/include/private/backend/Program.h b/filament/backend/include/private/backend/Program.h index 975e963227..4b6d17e65f 100644 --- a/filament/backend/include/private/backend/Program.h +++ b/filament/backend/include/private/backend/Program.h @@ -57,8 +57,7 @@ public: ~Program() noexcept; // sets the material name and variant for diagnostic purposes only - Program& diagnostics(utils::CString const& name, uint8_t variantKey = 0); - Program& diagnostics(utils::CString&& name, uint8_t variantKey = 0) noexcept; + Program& diagnostics(utils::CString const& name, uint8_t variantKey); // sets one of the program's shader (e.g. vertex, fragment) Program& shader(Shader shader, void const* data, size_t size) noexcept; @@ -105,7 +104,6 @@ private: friend utils::io::ostream& operator<< (utils::io::ostream& out, const Program& builder); #endif - // FIXME: none of these fields should be public as this is a public API UniformBlockInfo mUniformBlocks = {}; SamplerGroupInfo mSamplerGroups = {}; std::array mShadersSource; diff --git a/filament/backend/src/Program.cpp b/filament/backend/src/Program.cpp index 870782d52c..56b0bc5b6d 100644 --- a/filament/backend/src/Program.cpp +++ b/filament/backend/src/Program.cpp @@ -33,12 +33,6 @@ Program& Program::diagnostics(utils::CString const& name, uint8_t variant) { return *this; } -Program& Program::diagnostics(utils::CString&& name, uint8_t variant) noexcept { - name.swap(mName); - mVariant = variant; - return *this; -} - Program& Program::shader(Program::Shader shader, void const* data, size_t size) noexcept { ShaderBlob blob(size); std::copy_n((const uint8_t *)data, size, blob.data()); diff --git a/filament/include/filament/DebugRegistry.h b/filament/include/filament/DebugRegistry.h index 0633abe45c..018df14ddb 100644 --- a/filament/include/filament/DebugRegistry.h +++ b/filament/include/filament/DebugRegistry.h @@ -25,9 +25,6 @@ #include -// FIXME: could we get rid of -#include // for std::pair - #include namespace filament { @@ -57,12 +54,17 @@ public: Type type; //!< property type }; + struct PropertyArray { + Property const* array; + size_t size; + }; + /** * Queries the list of all available properties. * * @return A pair containing a pointer to a Property array and the size of this array. */ - std::pair getProperties() const noexcept; + PropertyArray getProperties() const noexcept; /** * Queries whether a property exists diff --git a/filament/src/DebugRegistry.cpp b/filament/src/DebugRegistry.cpp index e6a211b1c2..9388faa55e 100644 --- a/filament/src/DebugRegistry.cpp +++ b/filament/src/DebugRegistry.cpp @@ -53,7 +53,7 @@ void FDebugRegistry::registerProperty(utils::StaticString name, void *p, Type ty } } -inline std::pair FDebugRegistry::getProperties() const noexcept { +DebugRegistry::PropertyArray FDebugRegistry::getProperties() const noexcept { return {mProperties.data(), mProperties.size()}; } @@ -87,7 +87,7 @@ inline bool FDebugRegistry::getProperty(const char* name, T* UTILS_RESTRICT p) c // Trampoline calling into private implementation // ------------------------------------------------------------------------------------------------ -std::pair DebugRegistry::getProperties() const noexcept { +DebugRegistry::PropertyArray DebugRegistry::getProperties() const noexcept { return upcast(this)->getProperties(); } diff --git a/filament/src/PostProcessManager.cpp b/filament/src/PostProcessManager.cpp index 4763ed8377..1515c2fc22 100644 --- a/filament/src/PostProcessManager.cpp +++ b/filament/src/PostProcessManager.cpp @@ -2171,13 +2171,7 @@ FrameGraphId PostProcessManager::opaqueBlit(FrameGraph& fg, data.output = builder.declareRenderPass( builder.createTexture("opaque blit output", outDesc)); - // FIXME: here we use sample() instead of read() because this forces the - // backend to use a texture (instead of a renderbuffer). We need this because - // "implicit resolve" renderbuffers are currently not supported -- and - // implicit resolves are needed when taking the blit path. - // (we do this only when the texture does not request multisampling, since - // these are not sampleable). - data.input = (inputDesc.samples > 1) ? builder.read(input) : builder.sample(input); + data.input = builder.read(input); // We use a RenderPass for the source here, instead of just creating a render // target from data.input in the execute closure, because data.input may refer to diff --git a/filament/src/Renderer.cpp b/filament/src/Renderer.cpp index f2c2ba83b4..9662cf3df8 100644 --- a/filament/src/Renderer.cpp +++ b/filament/src/Renderer.cpp @@ -1013,12 +1013,11 @@ bool FRenderer::beginFrame(FSwapChain* swapChain, uint64_t vsyncSteadyClockTimeN // when the gpu will finish, otherwise we'll have inconsistent latency/frames. // TODO: evaluate if we can make it in time, and if not why. - // If the problem is cpu+gpu latency we can try to push the desired presentation time - // further away, but this has limits, as only 2 buffers are dequeuable. - // If the problem is the gpu is overwhelmed, then we need to - // - see if there is more headroom in dynamic resolution - // - or start skipping frames. Ideally lower the framerate too. - + // If the problem is cpu+gpu latency we can try to push the desired presentation time + // further away, but this has limits, as only 2 buffers are dequeuable. + // If the problem is the gpu is overwhelmed, then we need to + // - see if there is more headroom in dynamic resolution + // - or start skipping frames. Ideally lower the framerate to // presentation time is set to the middle of the period we're interested in steady_clock::time_point presentationTime = desiredPresentationTime - refreshPeriod / 2; driver.setPresentationTime(presentationTime.time_since_epoch().count()); diff --git a/filament/src/details/DebugRegistry.h b/filament/src/details/DebugRegistry.h index f8345fec3f..15d5486bc6 100644 --- a/filament/src/details/DebugRegistry.h +++ b/filament/src/details/DebugRegistry.h @@ -34,7 +34,7 @@ class FDebugRegistry : public DebugRegistry { public: FDebugRegistry() noexcept; - std::pair getProperties() const noexcept; + PropertyArray getProperties() const noexcept; bool hasProperty(const char* name) const noexcept;