Skip to content

Commit

Permalink
Remove excess allocation in FourierBSDF::Pdf()
Browse files Browse the repository at this point in the history
(Jaiyin Cao)
  • Loading branch information
mmp committed Apr 15, 2017
1 parent a71898d commit c44e009
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/reflection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -610,8 +610,8 @@ Float FourierBSDF::Pdf(const Vector3f &wo, const Vector3f &wi) const {
if (!bsdfTable.GetWeightsAndOffset(muI, &offsetI, weightsI) ||
!bsdfTable.GetWeightsAndOffset(muO, &offsetO, weightsO))
return 0;
Float *ak = ALLOCA(Float, bsdfTable.mMax * bsdfTable.nChannels);
memset(ak, 0, bsdfTable.mMax * bsdfTable.nChannels * sizeof(Float));
Float *ak = ALLOCA(Float, bsdfTable.mMax);
memset(ak, 0, bsdfTable.mMax * sizeof(Float));
int mMax = 0;
for (int o = 0; o < 4; ++o) {
for (int i = 0; i < 4; ++i) {
Expand Down

0 comments on commit c44e009

Please sign in to comment.