Skip to content

Commit

Permalink
fix some trivial TODOs (#8371)
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelflinger authored Jan 21, 2025
1 parent ada5791 commit 3f1e32c
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 16 deletions.
3 changes: 1 addition & 2 deletions libs/filamat/include/filamat/MaterialBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -585,8 +585,7 @@ class UTILS_PUBLIC MaterialBuilder : public MaterialBuilderBase {
*/
MaterialBuilder& optimization(Optimization optimization) noexcept;

// TODO: this is present here for matc's "--print" flag, but ideally does not belong inside
// MaterialBuilder.
// TODO: this is present here for matc's "--print" flag, but ideally does not belong inside MaterialBuilder.
//! If true, will output the generated GLSL shader code to stdout.
MaterialBuilder& printShaders(bool printShaders) noexcept;

Expand Down
1 change: 0 additions & 1 deletion libs/filamat/src/MaterialBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1368,7 +1368,6 @@ bool MaterialBuilder::checkMaterialLevelFeatures(MaterialInfo const& info) const
textureUsedByFilamentCount -= 1; // fog texture
}

// TODO: we need constants somewhere for these values
if (userSamplerCount > maxTextureCount - textureUsedByFilamentCount) {
slog.e << "Error: material \"" << mMaterialName.c_str()
<< "\" has feature level " << +info.featureLevel
Expand Down
1 change: 0 additions & 1 deletion libs/filamat/src/shaders/ShaderGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,6 @@ std::string ShaderGenerator::createVertexProgram(ShaderModel shaderModel,

CodeGenerator::generateSeparator(vs);

// TODO: should we generate per-view SIB in the vertex shader?
cg.generateSamplers(vs, DescriptorSetBindingPoints::PER_MATERIAL, material.sib);

// shader code
Expand Down
1 change: 0 additions & 1 deletion libs/utils/include/utils/Allocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@ class FreeList {
void push(void* p) noexcept {
assert_invariant(p);
assert_invariant(p >= mBegin && p < mEnd);
// TODO: assert this is one of our pointer (i.e.: it's address match one of ours)
Node* const head = static_cast<Node*>(p);
head->next = mHead;
mHead = head;
Expand Down
1 change: 0 additions & 1 deletion libs/utils/src/CallStack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include <stdint.h>
#include <stdio.h>

// FIXME: Some platforms do not have execinfo.h
#if !defined(__ANDROID__) && !defined(WIN32) && !defined(__EMSCRIPTEN__)
#include <execinfo.h>
#define HAS_EXECINFO 1
Expand Down
38 changes: 28 additions & 10 deletions libs/viewer/src/Settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -412,21 +412,30 @@ static int parse(jsmntok_t const* tokens, int i, const char* jsonChunk,
out->cascadeSplitPositions[0] = splitsVector[0];
out->cascadeSplitPositions[1] = splitsVector[1];
out->cascadeSplitPositions[2] = splitsVector[2];
// TODO: constantBias
// TODO: normalBias
// TODO: shadowFar
// TODO: shadowNearHint
// TODO: shadowFarHint
} else if (compare(tok, jsonChunk, "constantBias") == 0) {
i = parse(tokens, i + 1, jsonChunk, &out->constantBias);
} else if (compare(tok, jsonChunk, "normalBias") == 0) {
i = parse(tokens, i + 1, jsonChunk, &out->normalBias);
} else if (compare(tok, jsonChunk, "shadowFar") == 0) {
i = parse(tokens, i + 1, jsonChunk, &out->shadowFar);
} else if (compare(tok, jsonChunk, "shadowNearHint") == 0) {
i = parse(tokens, i + 1, jsonChunk, &out->shadowNearHint);
} else if (compare(tok, jsonChunk, "shadowFarHint") == 0) {
i = parse(tokens, i + 1, jsonChunk, &out->shadowFarHint);
} else if (compare(tok, jsonChunk, "stable") == 0) {
i = parse(tokens, i + 1, jsonChunk, &out->stable);
} else if (compare(tok, jsonChunk, "lispsm") == 0) {
i = parse(tokens, i + 1, jsonChunk, &out->lispsm);
// TODO: polygonOffsetConstant
// TODO: polygonOffsetSlope
} else if (compare(tok, jsonChunk, "polygonOffsetConstant") == 0) {
i = parse(tokens, i + 1, jsonChunk, &out->polygonOffsetConstant);
} else if (compare(tok, jsonChunk, "polygonOffsetSlope") == 0) {
i = parse(tokens, i + 1, jsonChunk, &out->polygonOffsetSlope);
} else if (compare(tok, jsonChunk, "screenSpaceContactShadows") == 0) {
i = parse(tokens, i + 1, jsonChunk, &out->screenSpaceContactShadows);
// TODO: stepCount
// TODO: maxShadowDistance
} else if (compare(tok, jsonChunk, "stepCount") == 0) {
i = parse(tokens, i + 1, jsonChunk, &out->stepCount);
} else if (compare(tok, jsonChunk, "maxShadowDistance") == 0) {
i = parse(tokens, i + 1, jsonChunk, &out->maxShadowDistance);
} else if (compare(tok, jsonChunk, "vsm") == 0) {
i = parse(tokens, i + 1, jsonChunk, &out->vsm);
} else if (compare(tok, jsonChunk, "shadowBulbRadius") == 0) {
Expand Down Expand Up @@ -810,10 +819,19 @@ static std::ostream& operator<<(std::ostream& out, const LightManager::ShadowOpt
<< "},\n"
<< "\"mapSize\": " << in.mapSize << ",\n"
<< "\"shadowCascades\": " << int(in.shadowCascades) << ",\n"
<< "\"cascadeSplitPositions\": " << (splitsVector) << "\n"
<< "\"cascadeSplitPositions\": " << splitsVector << "\n"
<< "\"constantBias\": " << in.constantBias << ",\n"
<< "\"normalBias\": " << in.normalBias << ",\n"
<< "\"shadowFar\": " << in.shadowFar << ",\n"
<< "\"shadowNearHint\": " << in.shadowNearHint << ",\n"
<< "\"shadowFarHint\": " << in.shadowFarHint << ",\n"
<< "\"stable\": " << to_string(in.stable) << ",\n"
<< "\"lispsm\": " << to_string(in.lispsm) << ",\n"
<< "\"polygonOffsetConstant\": " << in.polygonOffsetConstant << ",\n"
<< "\"polygonOffsetSlope\": " << in.polygonOffsetSlope << ",\n"
<< "\"screenSpaceContactShadows\": " << to_string(in.screenSpaceContactShadows) << ",\n"
<< "\"stepCount\": " << in.stepCount << ",\n"
<< "\"maxShadowDistance\": " << in.maxShadowDistance << ",\n"
<< "\"shadowBulbRadius\": " << in.shadowBulbRadius << ",\n"
<< "\"transform\": " << in.transform.xyzw << ",\n"
<< "}";
Expand Down

0 comments on commit 3f1e32c

Please sign in to comment.