70 #define DEVICE_MASK(type) (DeviceTypeMask)(1 << type)
116 assert(
id != info.
id ||
118 return id == info.
id;
235 string build_options =
"";
237 build_options +=
"-D__KERNEL_EXPERIMENTAL__ ";
242 build_options +=
" -D__NO_HAIR__";
245 build_options +=
" -D__NO_OBJECT_MOTION__";
248 build_options +=
" -D__NO_CAMERA_MOTION__";
251 build_options +=
" -D__NO_BAKING__";
254 build_options +=
" -D__NO_VOLUME__";
257 build_options +=
" -D__NO_SUBSURFACE__";
260 build_options +=
" -D__NO_BRANCHED_PATH__";
263 build_options +=
" -D__NO_PATCH_EVAL__";
266 build_options +=
" -D__NO_TRANSPARENT__";
269 build_options +=
" -D__NO_SHADOW_TRICKS__";
272 build_options +=
" -D__NO_PRINCIPLED__";
275 build_options +=
" -D__NO_DENOISING__";
278 build_options +=
" -D__NO_SHADER_RAYTRACE__";
280 return build_options;
334 virtual ~Device() noexcept(false);
351 fprintf(stderr,
"%s\n",
error.c_str());
456 return sub_device ==
this;
498 static bool need_types_update, need_devices_update;
505 static uint devices_initialized_mask;
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei width
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei height
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
void refit(btStridingMeshInterface *triangles, const btVector3 &aabbMin, const btVector3 &aabbMax)
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
vector< DeviceInfo > denoising_devices
vector< DeviceInfo > multi_devices
void add_denoising_devices(DenoiserType denoiser_type)
DenoiserTypeMask denoisers
bool operator==(const DeviceInfo &info)
bool has_adaptive_stop_per_sample
bool has_volume_decoupled
bool use_integrator_branched
bool modified(const DeviceRequestedFeatures &requested_features)
bool use_background_light
bool use_patch_evaluation
bool use_true_displacement
string get_build_options() const
DeviceRequestedFeatures()
Device(DeviceInfo &info_, Stats &stats_, Profiler &profiler_, bool background)
static Device * create(DeviceInfo &info, Stats &stats, Profiler &profiler, bool background=true)
virtual void release_optix_bvh(BVH *)
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 bool is_resident(device_ptr, Device *sub_device)
virtual device_ptr mem_alloc_sub_ptr(device_memory &, int, int)
static void free_memory()
virtual BVHLayoutMask get_bvh_layout_mask() const =0
static DeviceInfo dummy_device(const string &error_msg="")
int fallback_shader_program
virtual DeviceKernelStatus get_active_kernel_switch_state()
static vector< DeviceInfo > available_devices(uint device_type_mask=DEVICE_MASK_ALL)
virtual void const_copy_to(const char *name, void *host, size_t size)=0
virtual void mem_zero(device_memory &mem)=0
virtual void task_wait()=0
virtual bool wait_for_availability(const DeviceRequestedFeatures &)
virtual int device_number(Device *)
virtual void mem_copy_from(device_memory &mem, int y, int w, int h, int elem)=0
virtual ~Device() noexcept(false)
virtual void mem_free_sub_ptr(device_ptr)
virtual void unmap_neighbor_tiles(Device *, RenderTileNeighbors &)
virtual void build_bvh(BVH *bvh, Progress &progress, bool refit)
unsigned int vertex_buffer
virtual void task_cancel()=0
static DeviceType type_from_string(const char *name)
virtual void map_tile(Device *, RenderTile &)
virtual int get_split_task_count(DeviceTask &)
virtual const string & error_message()
virtual int mem_sub_ptr_alignment()
@ FALLBACK_SHADER_STATUS_SUCCESS
@ FALLBACK_SHADER_STATUS_ERROR
@ FALLBACK_SHADER_STATUS_NONE
virtual bool check_peer_access(Device *)
virtual void mem_free(device_memory &mem)=0
virtual void map_neighbor_tiles(Device *, RenderTileNeighbors &)
bool bind_fallback_display_space_shader(const float width, const float height)
virtual void set_error(const string &error)
virtual void mem_copy_to(device_memory &mem)=0
static string device_capabilities(uint device_type_mask=DEVICE_MASK_ALL)
virtual void * osl_memory()
friend class DeviceServer
virtual void task_add(DeviceTask &task)=0
static vector< DeviceType > available_types()
static string string_from_type(DeviceType type)
virtual void mem_alloc(device_memory &mem)=0
int image_texture_location
static DeviceInfo get_multi_device(const vector< DeviceInfo > &subdevices, int threads, bool background)
virtual bool load_kernels(const DeviceRequestedFeatures &)
virtual bool show_samples() const
@ DEVICE_KERNEL_USING_FEATURE_KERNEL
@ DEVICE_KERNEL_FEATURE_KERNEL_AVAILABLE
@ DEVICE_KERNEL_FEATURE_KERNEL_INVALID
std::ostream & operator<<(std::ostream &os, const DeviceRequestedFeatures &requested_features)
#define CCL_NAMESPACE_END
static void error(const char *str)
ListBase threads
list of all thread for every CPUDevice in cpudevices a thread exists.
struct blender::compositor::@172::@174 task
function< void()> unbind_display_space_shader_cb
function< void()> bind_display_space_shader_cb
#define MIN_ALIGNMENT_CPU_DATA_TYPES
CCL_NAMESPACE_BEGIN string string_printf(const char *format,...)
CCL_NAMESPACE_BEGIN typedef std::mutex thread_mutex