-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add is_complete() to UniformInput and Implement Checks in Demos #1718
Changes from all commits
5ad3d4c
a107605
1ea8aef
006cdf2
c15fe6f
89719a9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,21 @@ | ||
// Copyright 2015-2023 the openage authors. See copying.md for legal info. | ||
// Copyright 2015-2024 the openage authors. See copying.md for legal info. | ||
|
||
#include "util.h" | ||
|
||
#include "renderer/uniform_input.h" | ||
|
||
|
||
namespace openage::renderer::tests { | ||
|
||
bool check_uniform_completeness(const std::vector<Renderable> &renderables) { | ||
// Iterate over each renderable object | ||
for (const auto &renderable : renderables) { | ||
if (renderable.uniform and not renderable.uniform->is_complete()) { | ||
return false; | ||
} | ||
} | ||
|
||
return true; | ||
} | ||
|
||
} // namespace openage::renderer::tests |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
// Copyright 2023-2023 the openage authors. See copying.md for legal info. | ||
// Copyright 2023-2024 the openage authors. See copying.md for legal info. | ||
|
||
#pragma once | ||
|
||
#include <vector> | ||
|
||
#include "renderer/renderable.h" | ||
|
||
namespace openage::renderer::tests { | ||
|
||
|
@@ -11,4 +14,12 @@ namespace openage::renderer::tests { | |
opengl::GlContext::check_error(); \ | ||
printf("after %s\n", txt); | ||
|
||
/** | ||
* Check if all uniform values for the given renderables have been set. | ||
* | ||
* @param renderables The list of renderable objects to check. | ||
* @return true if all uniforms have been set, false otherwise. | ||
*/ | ||
bool check_uniform_completeness(const std::vector<Renderable> &renderables); | ||
|
||
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. this means we need to copy the renderables into the vector, which we don't need :) on another note: this is useful not only for the demos, but for the renderer in general. so it should be put outside the demo directory. |
||
} // namespace openage::renderer::tests |
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.
as you see above, the render pass stores the exact same renderables, so the render pass can get the feature to check if all its uniform inputs are complete.
when the render pass is added to the renderer, the check can be invoked there directly, i think.