Skip to content
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

fix: Fix testrender GPU regression with bad destruction order #1814

Merged
merged 2 commits into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/testrender/optixraytracer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1253,7 +1253,7 @@ OptixRaytracer::finalize_pixel_buffer()
void
OptixRaytracer::clear()
{
shaders().clear();
SimpleRaytracer::clear();
OPTIX_CHECK(optixDeviceContextDestroy(m_optix_ctx));
m_optix_ctx = 0;
}
Expand Down
6 changes: 6 additions & 0 deletions src/testrender/simpleraytracer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1101,4 +1101,10 @@ SimpleRaytracer::render(int xres, int yres)



void
SimpleRaytracer::clear()
{
shaders().clear();
}

OSL_NAMESPACE_EXIT
2 changes: 1 addition & 1 deletion src/testrender/simpleraytracer.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class SimpleRaytracer : public RendererServices {
virtual void prepare_render();
virtual void warmup() {}
virtual void render(int xres, int yres);
virtual void clear() {}
virtual void clear();

// After render, get the pixels into pixelbuf, if they aren't already.
virtual void finalize_pixel_buffer() {}
Expand Down
2 changes: 1 addition & 1 deletion src/testrender/testrender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ main(int argc, const char* argv[])

// We're done with the shading system now, destroy it
rend->clear();
delete rend;
delete shadingsys;
delete rend;
return EXIT_SUCCESS;
}
Loading