Skip to content
Snippets Groups Projects
Verified Commit 5e7afc4e authored by Tobias Frisch's avatar Tobias Frisch
Browse files

Shortened potential push constants filling

parent 149fe005
No related branches found
No related tags found
1 merge request!105Resolve "Refactor Core API"
......@@ -140,4 +140,24 @@ namespace vkcv {
return PushConstants(typeGuard<T>());
}
template<typename T>
PushConstants pushConstants(const T& value) {
auto pc = pushConstants<T>();
pc.template appendDrawcall(value);
return pc;
}
template<typename T>
PushConstants pushConstants(const std::vector<T>& values) {
auto pc = pushConstants<T>();
for (const T& value : values) {
if (!(pc.template appendDrawcall(value))) {
break;
}
}
return pc;
}
}
......@@ -100,9 +100,6 @@ int main(int argc, const char** argv) {
cameraManager.update(0.000001 * static_cast<double>(deltatime.count()));
glm::mat4 mvp = cameraManager.getActiveCamera().getMVP();
vkcv::PushConstants pushConstants = vkcv::pushConstants<glm::mat4>();
pushConstants.appendDrawcall(mvp);
auto cmdStream = core.createCommandStream(vkcv::QueueType::Graphics);
core.setDebugLabel(cmdStream, "Render Commands");
......@@ -111,7 +108,7 @@ int main(int argc, const char** argv) {
cmdStream,
trianglePass,
trianglePipeline,
pushConstants,
vkcv::pushConstants<glm::mat4>(mvp),
{ drawcall },
{ swapchainInput },
windowHandle);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment