Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/scene/shader.cpp
| Show First 20 Lines • Show All 389 Lines • ▼ Show 20 Lines | ShaderManager::ShaderManager() | ||||
| init_xyz_transforms(); | init_xyz_transforms(); | ||||
| } | } | ||||
| ShaderManager::~ShaderManager() | ShaderManager::~ShaderManager() | ||||
| { | { | ||||
| } | } | ||||
| ShaderManager *ShaderManager::create(int shadingsystem) | ShaderManager *ShaderManager::create(int shadingsystem, Device *device) | ||||
| { | { | ||||
| ShaderManager *manager; | ShaderManager *manager; | ||||
| (void)shadingsystem; /* Ignored when built without OSL. */ | (void)shadingsystem; /* Ignored when built without OSL. */ | ||||
| (void)device; | |||||
| #ifdef WITH_OSL | #ifdef WITH_OSL | ||||
| if (shadingsystem == SHADINGSYSTEM_OSL) { | if (shadingsystem == SHADINGSYSTEM_OSL) { | ||||
| manager = new OSLShaderManager(); | manager = new OSLShaderManager(device); | ||||
| } | } | ||||
| else | else | ||||
| #endif | #endif | ||||
| { | { | ||||
| manager = new SVMShaderManager(); | manager = new SVMShaderManager(); | ||||
| } | } | ||||
| return manager; | return manager; | ||||
| ▲ Show 20 Lines • Show All 302 Lines • ▼ Show 20 Lines | for (int i = 0; i < scene->shaders.size(); i++) { | ||||
| } | } | ||||
| /* On top of volume nodes, also check if we need volume sampling because | /* On top of volume nodes, also check if we need volume sampling because | ||||
| * e.g. an Emission node would slip through the KERNEL_FEATURE_NODE_VOLUME check */ | * e.g. an Emission node would slip through the KERNEL_FEATURE_NODE_VOLUME check */ | ||||
| if (shader->has_volume_connected) { | if (shader->has_volume_connected) { | ||||
| kernel_features |= KERNEL_FEATURE_VOLUME; | kernel_features |= KERNEL_FEATURE_VOLUME; | ||||
| } | } | ||||
| } | } | ||||
| if (use_osl()) { | |||||
| kernel_features |= KERNEL_FEATURE_OSL; | |||||
| } | |||||
| return kernel_features; | return kernel_features; | ||||
| } | } | ||||
| void ShaderManager::free_memory() | void ShaderManager::free_memory() | ||||
| { | { | ||||
| beckmann_table.free_memory(); | beckmann_table.free_memory(); | ||||
| #ifdef WITH_OSL | #ifdef WITH_OSL | ||||
| ▲ Show 20 Lines • Show All 161 Lines • Show Last 20 Lines | |||||