|
Blender
V2.93
|
#include <device.h>
Inherited by CPUDevice, DummyDevice, and MultiDevice.
Public Member Functions | |
| virtual | ~Device () noexcept(false) |
| virtual const string & | error_message () |
| bool | have_error () |
| virtual void | set_error (const string &error) |
| virtual bool | show_samples () const |
| virtual BVHLayoutMask | get_bvh_layout_mask () const =0 |
| virtual int | mem_sub_ptr_alignment () |
| virtual void | const_copy_to (const char *name, void *host, size_t size)=0 |
| virtual void * | osl_memory () |
| virtual bool | load_kernels (const DeviceRequestedFeatures &) |
| virtual bool | wait_for_availability (const DeviceRequestedFeatures &) |
| virtual DeviceKernelStatus | get_active_kernel_switch_state () |
| virtual int | get_split_task_count (DeviceTask &) |
| virtual void | task_add (DeviceTask &task)=0 |
| virtual void | task_wait ()=0 |
| virtual void | task_cancel ()=0 |
| virtual void | draw_pixels (device_memory &mem, int y, int w, int h, int width, int height, int dx, int dy, int dw, int dh, bool transparent, const DeviceDrawParams &draw_params) |
| virtual void | build_bvh (BVH *bvh, Progress &progress, bool refit) |
| virtual void | release_optix_bvh (BVH *) |
| virtual void | map_tile (Device *, RenderTile &) |
| virtual int | device_number (Device *) |
| virtual void | map_neighbor_tiles (Device *, RenderTileNeighbors &) |
| virtual void | unmap_neighbor_tiles (Device *, RenderTileNeighbors &) |
| virtual bool | is_resident (device_ptr, Device *sub_device) |
| virtual bool | check_peer_access (Device *) |
Static Public Member Functions | |
| static Device * | create (DeviceInfo &info, Stats &stats, Profiler &profiler, bool background=true) |
| static DeviceType | type_from_string (const char *name) |
| static string | string_from_type (DeviceType type) |
| static vector< DeviceType > | available_types () |
| static vector< DeviceInfo > | available_devices (uint device_type_mask=DEVICE_MASK_ALL) |
| static DeviceInfo | dummy_device (const string &error_msg="") |
| static string | device_capabilities (uint device_type_mask=DEVICE_MASK_ALL) |
| static DeviceInfo | get_multi_device (const vector< DeviceInfo > &subdevices, int threads, bool background) |
| static void | tag_update () |
| static void | free_memory () |
Public Attributes | |
| DeviceInfo | info |
| Stats & | stats |
| Profiler & | profiler |
Protected Types | |
| enum | { FALLBACK_SHADER_STATUS_NONE = 0 , FALLBACK_SHADER_STATUS_ERROR , FALLBACK_SHADER_STATUS_SUCCESS } |
Protected Member Functions | |
| Device (DeviceInfo &info_, Stats &stats_, Profiler &profiler_, bool background) | |
| bool | bind_fallback_display_space_shader (const float width, const float height) |
| virtual device_ptr | mem_alloc_sub_ptr (device_memory &, int, int) |
| virtual void | mem_free_sub_ptr (device_ptr) |
| virtual void | mem_alloc (device_memory &mem)=0 |
| virtual void | mem_copy_to (device_memory &mem)=0 |
| virtual void | mem_copy_from (device_memory &mem, int y, int w, int h, int elem)=0 |
| virtual void | mem_zero (device_memory &mem)=0 |
| virtual void | mem_free (device_memory &mem)=0 |
Protected Attributes | |
| bool | background |
| string | error_msg |
| unsigned int | vertex_buffer |
| int | fallback_status |
| int | fallback_shader_program |
| int | image_texture_location |
| int | fullscreen_location |
Friends | |
| class | device_sub_ptr |
| class | MultiDevice |
| class | DeviceServer |
| class | device_memory |
|
protected |
|
inlineprotected |
|
virtualnoexcept |
Definition at line 82 of file device.cpp.
References background, fallback_shader_program, and vertex_buffer.
|
static |
Definition at line 488 of file device.cpp.
References device_cpu_info(), device_cuda_info(), device_cuda_init(), DEVICE_MASK_CPU, DEVICE_MASK_CUDA, DEVICE_MASK_NETWORK, DEVICE_MASK_OPENCL, DEVICE_MASK_OPTIX, device_network_info(), device_opencl_info(), device_opencl_init(), device_optix_info(), device_optix_init(), blender::compositor::devices, info, and mask().
Referenced by DeviceInfo::add_denoising_devices(), available_devices_func(), blender_device_info(), main(), and options_parse().
|
static |
Definition at line 469 of file device.cpp.
References DEVICE_CPU, DEVICE_CUDA, DEVICE_NETWORK, DEVICE_OPENCL, DEVICE_OPTIX, and types.
Referenced by get_device_types_func(), main(), and options_parse().
Definition at line 197 of file device.cpp.
References bind_fallback_shader(), fallback_shader_program, FALLBACK_SHADER_STATUS_ERROR, FALLBACK_SHADER_STATUS_NONE, FALLBACK_SHADER_STATUS_SUCCESS, fallback_status, fullscreen_location, height, image_texture_location, LOG, and width.
Referenced by draw_pixels().
Reimplemented in MultiDevice, and CPUDevice.
Definition at line 369 of file device.cpp.
References BVH2::build(), BVHParams::bvh_layout, BVH_LAYOUT_BVH2, BVH::params, refit(), BVH2::refit(), and stats.
Referenced by CPUDevice::build_bvh(), MultiDevice::build_bvh(), Geometry::compute_bvh(), and GeometryManager::device_update_bvh().
|
inlinevirtual |
Definition at line 458 of file device.h.
Referenced by MultiDevice::MultiDevice().
|
pure virtual |
Implemented in MultiDevice, CPUDevice, and DummyDevice.
Referenced by MultiDevice::const_copy_to(), Scene::device_update(), GeometryManager::displace(), and shade_background_pixels().
|
static |
Definition at line 382 of file device.cpp.
References background, DEVICE_CPU, device_cpu_create(), DEVICE_CUDA, device_cuda_create(), device_cuda_init(), device_dummy_create(), device_multi_create(), DEVICE_NETWORK, device_network_create(), DEVICE_OPENCL, device_opencl_create(), device_opencl_init(), DEVICE_OPTIX, device_optix_create(), device_optix_init(), info, DeviceInfo::multi_devices, NULL, profiler, stats, and DeviceInfo::type.
Referenced by Denoiser::Denoiser(), main(), MultiDevice::MultiDevice(), Session::Session(), and RenderGraph::SetUp().
|
static |
Definition at line 573 of file device.cpp.
References device_cpu_capabilities(), device_cuda_capabilities(), device_cuda_init(), DEVICE_MASK_CPU, DEVICE_MASK_CUDA, DEVICE_MASK_OPENCL, device_opencl_capabilities(), device_opencl_init(), and mask().
Referenced by system_info_func().
|
inlinevirtual |
Reimplemented in MultiDevice.
Definition at line 441 of file device.h.
Referenced by Session::acquire_tile().
|
virtual |
Reimplemented in MultiDevice.
Definition at line 234 of file device.cpp.
References DeviceDrawParams::bind_display_space_shader_cb, bind_fallback_display_space_shader(), device_memory::data_type, fallback_shader_program, float(), glDisable, glEnable, height, device_memory::host_pointer, mem_copy_from(), MEM_PIXELS, device_memory::memory_elements_size(), NULL, device_memory::type, TYPE_HALF, DeviceDrawParams::unbind_display_space_shader_cb, vertex_buffer, w(), width, and y.
Referenced by DisplayBuffer::draw(), and MultiDevice::draw_pixels().
|
static |
Definition at line 565 of file device.cpp.
References DEVICE_DUMMY, DeviceInfo::error_msg, error_msg, info, and DeviceInfo::type.
Referenced by blender_device_info().
|
inlinevirtual |
Reimplemented in MultiDevice.
Definition at line 338 of file device.h.
References error_msg.
Referenced by MultiDevice::error_message(), have_error(), Scene::load_kernels(), Session::run_cpu(), Session::run_gpu(), and Session::Session().
|
static |
Definition at line 687 of file device.cpp.
References vector< value_type, allocator_type >::free_memory().
Referenced by exit_func(), and tag_update().
|
inlinevirtual |
Reimplemented in MultiDevice.
Definition at line 397 of file device.h.
References DEVICE_KERNEL_USING_FEATURE_KERNEL.
Referenced by MultiDevice::get_active_kernel_switch_state(), Session::run_cpu(), Session::run_gpu(), and Scene::update().
|
pure virtual |
Implemented in MultiDevice, DummyDevice, and CPUDevice.
Referenced by Geometry::compute_bvh(), GeometryManager::device_update_bvh(), and MultiDevice::get_bvh_layout_mask().
|
static |
Definition at line 604 of file device.cpp.
References background, DeviceInfo::cpu_threads, DENOISER_ALL, DeviceInfo::denoisers, DeviceInfo::description, DEVICE_CPU, DEVICE_MULTI, DeviceInfo::has_adaptive_stop_per_sample, DeviceInfo::has_branched_path, DeviceInfo::has_half_images, DeviceInfo::has_nanovdb, DeviceInfo::has_osl, DeviceInfo::has_peer_memory, DeviceInfo::has_profiling, DeviceInfo::has_volume_decoupled, DeviceInfo::id, info, max, DeviceInfo::multi_devices, DeviceInfo::num, system_cpu_thread_count(), blender::compositor::threads, DeviceInfo::type, and VLOG.
Referenced by blender_device_info().
|
inlinevirtual |
Reimplemented in MultiDevice, and CPUDevice.
Definition at line 403 of file device.h.
Referenced by MultiDevice::get_split_task_count().
|
inline |
Definition at line 342 of file device.h.
References error_message().
Referenced by Scene::device_update(), DeviceSplitKernel::path_trace(), and set_error().
|
inlinevirtual |
Reimplemented in MultiDevice.
Definition at line 452 of file device.h.
Referenced by device_memory::is_resident().
|
inlinevirtual |
Reimplemented in CPUDevice, and MultiDevice.
Definition at line 380 of file device.h.
Referenced by Denoiser::Denoiser(), MultiDevice::load_kernels(), and Scene::load_kernels().
|
inlinevirtual |
Reimplemented in MultiDevice.
Definition at line 445 of file device.h.
Referenced by Session::map_neighbor_tiles().
|
inlinevirtual |
Reimplemented in MultiDevice.
Definition at line 438 of file device.h.
Referenced by DenoiseTask::acquire_tile(), and Session::acquire_tile().
|
protectedpure virtual |
Implemented in MultiDevice, CPUDevice, and DummyDevice.
Referenced by device_memory::device_alloc(), and MultiDevice::mem_alloc().
|
inlineprotectedvirtual |
Reimplemented in CPUDevice.
Definition at line 324 of file device.h.
Referenced by device_sub_ptr::device_sub_ptr().
|
protectedpure virtual |
Implemented in MultiDevice, DummyDevice, and CPUDevice.
Referenced by device_memory::device_copy_from(), draw_pixels(), and MultiDevice::mem_copy_from().
|
protectedpure virtual |
Implemented in MultiDevice, CPUDevice, and DummyDevice.
Referenced by device_memory::device_copy_to(), and MultiDevice::mem_copy_to().
|
protectedpure virtual |
Implemented in MultiDevice, CPUDevice, and DummyDevice.
Referenced by device_memory::device_free(), MultiDevice::mem_free(), and MultiDevice::unmap_neighbor_tiles().
|
inlineprotectedvirtual |
Definition at line 330 of file device.h.
Referenced by device_sub_ptr::~device_sub_ptr().
|
inlinevirtual |
Definition at line 365 of file device.h.
References MIN_ALIGNMENT_CPU_DATA_TYPES.
Referenced by DenoisingTask::setup_denoising_buffer().
|
protectedpure virtual |
Implemented in MultiDevice, CPUDevice, and DummyDevice.
Referenced by device_memory::device_zero(), and MultiDevice::mem_zero().
|
inlinevirtual |
Reimplemented in MultiDevice, and CPUDevice.
Definition at line 374 of file device.h.
References NULL.
Referenced by GeometryManager::device_free(), and GeometryManager::update_osl_attributes().
|
inlinevirtual |
|
inlinevirtual |
Definition at line 346 of file device.h.
References error(), error_msg, and have_error().
Referenced by DeviceSplitKernel::path_trace().
|
inlinevirtual |
Reimplemented in MultiDevice, and CPUDevice.
Definition at line 354 of file device.h.
Referenced by Session::update_status_time().
|
static |
Definition at line 451 of file device.cpp.
References DEVICE_CPU, DEVICE_CUDA, DEVICE_MULTI, DEVICE_NETWORK, DEVICE_OPENCL, DEVICE_OPTIX, and type.
Referenced by available_devices_func(), main(), and options_parse().
|
static |
Definition at line 682 of file device.cpp.
References free_memory().
Referenced by debug_flags_reset_func(), and debug_flags_update_func().
|
pure virtual |
Implemented in MultiDevice, CPUDevice, and DummyDevice.
Referenced by Session::copy_to_display_buffer(), GeometryManager::displace(), DenoiseTask::exec(), Session::render(), shade_background_pixels(), and MultiDevice::task_add().
|
pure virtual |
Implemented in MultiDevice, DummyDevice, and CPUDevice.
Referenced by Session::reset_cpu(), and MultiDevice::task_cancel().
|
pure virtual |
Implemented in MultiDevice, DummyDevice, and CPUDevice.
Referenced by Session::copy_to_display_buffer(), GeometryManager::displace(), DenoiseTask::exec(), Session::render(), Session::run_cpu(), Session::run_gpu(), shade_background_pixels(), MultiDevice::task_add(), and MultiDevice::task_wait().
|
static |
Definition at line 433 of file device.cpp.
References DEVICE_CPU, DEVICE_CUDA, DEVICE_MULTI, DEVICE_NETWORK, DEVICE_NONE, DEVICE_OPENCL, and DEVICE_OPTIX.
Referenced by available_devices_func(), main(), and options_parse().
|
inlinevirtual |
Reimplemented in MultiDevice.
Definition at line 448 of file device.h.
Referenced by Session::unmap_neighbor_tiles().
|
inlinevirtual |
Reimplemented in MultiDevice.
Definition at line 389 of file device.h.
Referenced by Scene::update(), and MultiDevice::wait_for_availability().
|
friend |
|
friend |
|
friend |
|
protected |
Definition at line 314 of file device.h.
Referenced by create(), get_multi_device(), MultiDevice::MultiDevice(), and ~Device().
|
protected |
Definition at line 315 of file device.h.
Referenced by dummy_device(), DummyDevice::DummyDevice(), error_message(), MultiDevice::error_message(), and set_error().
|
protected |
Definition at line 319 of file device.h.
Referenced by bind_fallback_display_space_shader(), draw_pixels(), and ~Device().
|
protected |
Definition at line 319 of file device.h.
Referenced by bind_fallback_display_space_shader().
|
protected |
Definition at line 320 of file device.h.
Referenced by bind_fallback_display_space_shader().
|
protected |
Definition at line 320 of file device.h.
Referenced by bind_fallback_display_space_shader().
| DeviceInfo Device::info |
Definition at line 337 of file device.h.
Referenced by Session::acquire_tile(), available_devices(), MultiDevice::build_bvh(), CPUDevice::CPUDevice(), create(), ShaderManager::device_update_common(), dummy_device(), DummyDevice::DummyDevice(), get_multi_device(), CPUDevice::get_split_task_count(), main(), MultiDevice::MultiDevice(), DeviceSplitKernel::path_trace(), Scene::Scene(), CPUDevice::show_samples(), Session::steal_tile(), and CPUDevice::task_add().
| Profiler& Device::profiler |
Definition at line 362 of file device.h.
Referenced by create(), MultiDevice::MultiDevice(), CPUDevice::thread_denoise(), and CPUDevice::thread_render().
| Stats& Device::stats |
Definition at line 361 of file device.h.
Referenced by build_bvh(), CPUDevice::build_bvh(), create(), MultiDevice::find_suitable_mem_device(), CPUDevice::global_alloc(), CPUDevice::global_free(), CPUDevice::mem_alloc(), MultiDevice::mem_alloc(), MultiDevice::mem_copy_to(), CPUDevice::mem_free(), MultiDevice::mem_free(), MultiDevice::mem_zero(), MultiDevice::MultiDevice(), CPUDevice::tex_alloc(), and CPUDevice::tex_free().
|
protected |
Definition at line 318 of file device.h.
Referenced by draw_pixels(), and ~Device().