Fix T40370: cycles CUDA baking timeout with high number of AA samples.

Now baking does one AA sample at a time, just like final render. There is
also some code for shader antialiasing that solves T40369 but it is disabled
for now because there may be unpredictable side effects.
This commit is contained in:
Brecht Van Lommel
2014-06-06 14:40:09 +02:00
parent 553264ff8e
commit e4e58d4612
17 changed files with 249 additions and 169 deletions

View File

@@ -15,6 +15,7 @@
*/
#include "bake.h"
#include "integrator.h"
CCL_NAMESPACE_BEGIN
@@ -152,6 +153,7 @@ bool BakeManager::bake(Device *device, DeviceScene *dscene, Scene *scene, Progre
task.shader_eval_type = shader_type;
task.shader_x = 0;
task.shader_w = d_output.size();
task.num_samples = is_aa_pass(shader_type)? scene->integrator->aa_samples: 1;
task.get_cancel = function_bind(&Progress::get_cancel, &progress);
device->task_add(task);
@@ -203,4 +205,35 @@ void BakeManager::device_free(Device *device, DeviceScene *dscene)
{
}
bool BakeManager::is_aa_pass(ShaderEvalType type)
{
switch(type) {
case SHADER_EVAL_UV:
case SHADER_EVAL_NORMAL:
return false;
default:
return true;
}
}
bool BakeManager::is_light_pass(ShaderEvalType type)
{
switch(type) {
case SHADER_EVAL_AO:
case SHADER_EVAL_COMBINED:
case SHADER_EVAL_SHADOW:
case SHADER_EVAL_DIFFUSE_DIRECT:
case SHADER_EVAL_GLOSSY_DIRECT:
case SHADER_EVAL_TRANSMISSION_DIRECT:
case SHADER_EVAL_SUBSURFACE_DIRECT:
case SHADER_EVAL_DIFFUSE_INDIRECT:
case SHADER_EVAL_GLOSSY_INDIRECT:
case SHADER_EVAL_TRANSMISSION_INDIRECT:
case SHADER_EVAL_SUBSURFACE_INDIRECT:
return true;
default:
return false;
}
}
CCL_NAMESPACE_END