Fix #112632: crash batch generating previews with Cycles #112971
@ -205,13 +205,17 @@ void GPU_render_end()
|
||||
{
|
||||
GPUBackend *backend = GPUBackend::get();
|
||||
BLI_assert(backend);
|
||||
backend->render_end();
|
||||
if (backend) {
|
||||
backend->render_end();
|
||||
}
|
||||
}
|
||||
void GPU_render_step()
|
||||
{
|
||||
GPUBackend *backend = GPUBackend::get();
|
||||
BLI_assert(backend);
|
||||
backend->render_step();
|
||||
if (backend) {
|
||||
backend->render_step();
|
||||
}
|
||||
}
|
||||
|
||||
/** \} */
|
||||
|
@ -2459,7 +2459,10 @@ void RE_RenderAnim(Render *re,
|
||||
void RE_PreviewRender(Render *re, Main *bmain, Scene *sce)
|
||||
{
|
||||
/* Ensure within GPU render boundary. */
|
||||
GPU_render_begin();
|
||||
const bool use_gpu = GPU_backend_get_type() != GPU_BACKEND_NONE;
|
||||
if (use_gpu) {
|
||||
GPU_render_begin();
|
||||
}
|
||||
|
||||
Object *camera;
|
||||
int winx, winy;
|
||||
@ -2483,7 +2486,9 @@ void RE_PreviewRender(Render *re, Main *bmain, Scene *sce)
|
||||
}
|
||||
|
||||
/* Close GPU render boundary. */
|
||||
GPU_render_end();
|
||||
if (use_gpu) {
|
||||
GPU_render_end();
|
||||
}
|
||||
}
|
||||
|
||||
/* NOTE: repeated win/disprect calc... solve that nicer, also in compo. */
|
||||
|
Loading…
Reference in New Issue
Block a user