-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
only render what’s visible #664
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,3 +27,11 @@ bool RenderObject::hasCustomModelMatrix() { return setCustomModelMatrix; } | |
std::vector<float> RenderObject::getCustomModelMatrix() { return modelMatrix; } | ||
|
||
bool RenderObject::isScreenSpaceCoords() { return screenSpaceCoords; } | ||
|
||
void RenderObject::setHidden(bool _hidden) { | ||
hidden = _hidden; | ||
} | ||
|
||
bool RenderObject::isHidden() { | ||
return hidden; | ||
} | ||
Comment on lines
+31
to
+37
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification Based on the search results, I can see that similar properties in the codebase that require thread safety are using
Make visibility state thread-safe using std::atomic The visibility state should be made thread-safe by using std::atomic<bool> hidden; // instead of bool hidden 🔗 Analysis chainConsider thread safety for visibility state. Since render objects might be accessed from multiple threads (e.g., render thread and main thread), consider whether the visibility state needs thread protection. Let's check if other similar properties in the codebase use thread protection: 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Search for mutex/atomic usage in render-related files
rg -A 2 "std::(mutex|atomic)" --type cpp
Length of output: 26972 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding pure virtual methods to an interface can cause breaking changes
Introducing new pure virtual methods
virtual void setHidden(bool hidden) = 0;
andvirtual bool isHidden() = 0;
toRenderObjectInterface
can be a breaking change. All classes inheriting from this interface must now implement these methods, which can cause compilation errors in existing codebases.To maintain backward compatibility, consider providing default implementations in the base class or using the "interface segregation" principle to create a new interface for the hidden functionality.