Skip to content

Commit

Permalink
Can't be certain we have a depth buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
szellmann committed May 11, 2024
1 parent 6caaedd commit a40cc45
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions frame/Frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,15 @@ void Frame::renderFrame()
#ifdef WITH_CUDA
cuda::for_each(0, size.x, 0, size.y, [=] VSNRAY_GPU_FUNC (int x, int y) {
frame.accumBuffer[x+size.x*y] = vec4{0.f};
frame.depthBuffer[x+size.x*y] = 1e31f;
if (frame.depthBuffer) {
frame.depthBuffer[x+size.x*y] = 1e31f;
}
});
#else
std::fill(frame.accumBuffer, frame.accumBuffer + size.x * size.y, vec4{0.f});
std::fill(frame.depthBuffer, frame.depthBuffer + size.x * size.y, 1e31f);
if (frame.depthBuffer) {
std::fill(frame.depthBuffer, frame.depthBuffer + size.x * size.y, 1e31f);
}
#endif
rend.rendererState.accumID = 0;
m_nextFrameReset = false;
Expand Down

0 comments on commit a40cc45

Please sign in to comment.