We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
There are a few superfluous .data() and get_pointer() instead of just using the accessor.
.data()
get_pointer()
accessor
For example instead of
render<width, height, samples>(myQueue, fb.data(), hittables.data(), hittables.size(), cam); save_image<width, height>(fb.data());
render<width, height, samples>(myQueue, fb, hittables, cam); save_image<width, height>(fb);
Also replace hittables_ptr, num_hittables by hittables_acc since the accessor has the size too.
hittables_ptr, num_hittables
hittables_acc
Then probably hit_world and get_color can be just plain functions. I have the feeling that you could replace
hit_world
get_color
auto render_kernel = pixel_renderer<width, height, samples, depth>( frame_ptr, hittables_ptr, num_hittables, cam); executor<width, height>(cgh, render_kernel);
by
executor<width, height>(cgh, [=] (...) { ... here is the full renderer code });
and in the executor do not copy the lambda:
void executor(auto& cgh, T& render_kernel) {
(or perhaps even const T& render_kernel).
const T& render_kernel
I think all these copies explain the slowdown from #33
Be sure you do not copy anything in a useless way. Pass by reference or at least std::forward.
std::forward
The text was updated successfully, but these errors were encountered:
lforg37
No branches or pull requests
There are a few superfluous
.data()
andget_pointer()
instead of just using theaccessor
.For example instead of
Also replace
hittables_ptr, num_hittables
byhittables_acc
since the accessor has the size too.Then probably
hit_world
andget_color
can be just plain functions.I have the feeling that you could replace
auto render_kernel = pixel_renderer<width, height, samples, depth>( frame_ptr, hittables_ptr, num_hittables, cam); executor<width, height>(cgh, render_kernel);
by
and in the executor do not copy the lambda:
(or perhaps even
const T& render_kernel
).I think all these copies explain the slowdown from #33
Be sure you do not copy anything in a useless way. Pass by reference or at least
std::forward
.The text was updated successfully, but these errors were encountered: