fix a few easy "fixmes" and "todos"

This commit is contained in:
Mathias Agopian
2021-07-09 10:25:22 -07:00
committed by Mathias Agopian
parent 92628ade8e
commit fda06fe8a0
7 changed files with 16 additions and 29 deletions
@@ -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<ShaderBlob, SHADER_TYPE_COUNT> mShadersSource;
-6
View File
@@ -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());
+6 -4
View File
@@ -25,9 +25,6 @@
#include <math/mathfwd.h>
// FIXME: could we get rid of <utility>
#include <utility> // for std::pair
#include <stdint.h>
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<Property const*, size_t> getProperties() const noexcept;
PropertyArray getProperties() const noexcept;
/**
* Queries whether a property exists
+2 -2
View File
@@ -53,7 +53,7 @@ void FDebugRegistry::registerProperty(utils::StaticString name, void *p, Type ty
}
}
inline std::pair<DebugRegistry::Property const *, size_t> 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::Property const*, size_t> DebugRegistry::getProperties() const noexcept {
DebugRegistry::PropertyArray DebugRegistry::getProperties() const noexcept {
return upcast(this)->getProperties();
}
+1 -7
View File
@@ -2171,13 +2171,7 @@ FrameGraphId<FrameGraphTexture> 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
+5 -6
View File
@@ -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());
+1 -1
View File
@@ -34,7 +34,7 @@ class FDebugRegistry : public DebugRegistry {
public:
FDebugRegistry() noexcept;
std::pair<Property const*, size_t> getProperties() const noexcept;
PropertyArray getProperties() const noexcept;
bool hasProperty(const char* name) const noexcept;