From b4d9b8b7f8d69165bec0c0006cbc1cd03e769081 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 12 Nov 2021 16:43:43 +0100 Subject: Fix T91893, T92455: wrong transmission pass with hair and multiscatter glass We need to increase GPU memory usage a bit. Unfortunately we can't get away with writing either reflection or transmission passes because these BSDFs may scatter in either direction but still must be in a fixed reflection or transmission category to match up with the color passes. --- intern/cycles/scene/film.cpp | 11 ++++------- intern/cycles/scene/osl.cpp | 33 ++++++++++++++++++++------------- 2 files changed, 24 insertions(+), 20 deletions(-) (limited to 'intern/cycles/scene') diff --git a/intern/cycles/scene/film.cpp b/intern/cycles/scene/film.cpp index 591f309384e..cdaaea6be2f 100644 --- a/intern/cycles/scene/film.cpp +++ b/intern/cycles/scene/film.cpp @@ -187,8 +187,6 @@ void Film::device_update(Device *device, DeviceScene *dscene, Scene *scene) kfilm->pass_transmission_indirect = PASS_UNUSED; kfilm->pass_volume_direct = PASS_UNUSED; kfilm->pass_volume_indirect = PASS_UNUSED; - kfilm->pass_volume_direct = PASS_UNUSED; - kfilm->pass_volume_indirect = PASS_UNUSED; kfilm->pass_shadow = PASS_UNUSED; /* Mark passes as unused so that the kernel knows the pass is inaccessible. */ @@ -673,13 +671,12 @@ uint Film::get_kernel_features(const Scene *scene) const kernel_features |= KERNEL_FEATURE_DENOISING; } - if (pass_type != PASS_NONE && pass_type != PASS_COMBINED && - pass_type <= PASS_CATEGORY_LIGHT_END) { + if (pass_type >= PASS_DIFFUSE && pass_type <= PASS_VOLUME_INDIRECT) { kernel_features |= KERNEL_FEATURE_LIGHT_PASSES; + } - if (pass_type == PASS_SHADOW) { - kernel_features |= KERNEL_FEATURE_SHADOW_PASS; - } + if (pass_type == PASS_SHADOW) { + kernel_features |= KERNEL_FEATURE_SHADOW_PASS; } if (pass_type == PASS_AO) { diff --git a/intern/cycles/scene/osl.cpp b/intern/cycles/scene/osl.cpp index c5f38d4f270..0844bff7d4a 100644 --- a/intern/cycles/scene/osl.cpp +++ b/intern/cycles/scene/osl.cpp @@ -274,19 +274,26 @@ void OSLShaderManager::shading_system_init() "diffuse_ancestor", /* PATH_RAY_DIFFUSE_ANCESTOR */ - "__unused__", /* PATH_RAY_SINGLE_PASS_DONE */ - "__unused__", /* PATH_RAY_TRANSPARENT_BACKGROUND */ - "__unused__", /* PATH_RAY_TERMINATE_IMMEDIATE */ - "__unused__", /* PATH_RAY_TERMINATE_AFTER_TRANSPARENT */ - "__unused__", /* PATH_RAY_EMISSION */ - "__unused__", /* PATH_RAY_SUBSURFACE */ - "__unused__", /* PATH_RAY_DENOISING_FEATURES */ - "__unused__", /* PATH_RAY_REFLECT_PASS */ - "__unused__", /* PATH_RAY_TRANSMISSION_PASS */ - "__unused__", /* PATH_RAY_VOLUME_PASS */ - "__unused__", /* PATH_RAY_SHADOW_FOR_LIGHT */ - "__unused__", /* PATH_RAY_SHADOW_CATCHER_HIT */ - "__unused__", /* PATH_RAY_SHADOW_CATCHER_PASS */ + /* Remaining irrelevant bits up to 32. */ + "__unused__", + "__unused__", + "__unused__", + "__unused__", + "__unused__", + "__unused__", + "__unused__", + "__unused__", + "__unused__", + "__unused__", + "__unused__", + "__unused__", + "__unused__", + "__unused__", + "__unused__", + "__unused__", + "__unused__", + "__unused__", + "__unused__", }; const int nraytypes = sizeof(raytypes) / sizeof(raytypes[0]); -- cgit v1.2.3