diff options
Diffstat (limited to 'intern/cycles/device/device.h')
-rw-r--r-- | intern/cycles/device/device.h | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/intern/cycles/device/device.h b/intern/cycles/device/device.h index ac06e561795..b3b693c630c 100644 --- a/intern/cycles/device/device.h +++ b/intern/cycles/device/device.h @@ -124,6 +124,12 @@ public: /* Use various shadow tricks, such as shadow catcher. */ bool use_shadow_tricks; + /* Per-uber shader usage flags. */ + bool use_principled; + + /* Denoising features. */ + bool use_denoising; + DeviceRequestedFeatures() { /* TODO(sergey): Find more meaningful defaults. */ @@ -141,6 +147,8 @@ public: use_patch_evaluation = false; use_transparent = false; use_shadow_tricks = false; + use_principled = false; + use_denoising = false; } bool modified(const DeviceRequestedFeatures& requested_features) @@ -158,7 +166,9 @@ public: use_integrator_branched == requested_features.use_integrator_branched && use_patch_evaluation == requested_features.use_patch_evaluation && use_transparent == requested_features.use_transparent && - use_shadow_tricks == requested_features.use_shadow_tricks); + use_shadow_tricks == requested_features.use_shadow_tricks && + use_principled == requested_features.use_principled && + use_denoising == requested_features.use_denoising); } /* Convert the requested features structure to a build options, @@ -205,6 +215,12 @@ public: if(!use_shadow_tricks) { build_options += " -D__NO_SHADOW_TRICKS__"; } + if(!use_principled) { + build_options += " -D__NO_PRINCIPLED__"; + } + if(!use_denoising) { + build_options += " -D__NO_DENOISING__"; + } return build_options; } }; @@ -220,6 +236,7 @@ struct DeviceDrawParams { }; class Device { + friend class device_sub_ptr; protected: Device(DeviceInfo& info_, Stats &stats_, bool background) : background(background), vertex_buffer(0), info(info_), stats(stats_) {} @@ -229,6 +246,14 @@ protected: /* used for real time display */ unsigned int vertex_buffer; + virtual device_ptr mem_alloc_sub_ptr(device_memory& /*mem*/, int /*offset*/, int /*size*/, MemoryType /*type*/) + { + /* Only required for devices that implement denoising. */ + assert(false); + return (device_ptr) 0; + } + virtual void mem_free_sub_ptr(device_ptr /*ptr*/) {}; + public: virtual ~Device(); @@ -257,6 +282,8 @@ public: virtual void mem_zero(device_memory& mem) = 0; virtual void mem_free(device_memory& mem) = 0; + virtual int mem_address_alignment() { return 16; } + /* constant memory */ virtual void const_copy_to(const char *name, void *host, size_t size) = 0; @@ -304,6 +331,8 @@ public: /* multi device */ virtual void map_tile(Device * /*sub_device*/, RenderTile& /*tile*/) {} virtual int device_number(Device * /*sub_device*/) { return 0; } + virtual void map_neighbor_tiles(Device * /*sub_device*/, RenderTile * /*tiles*/) {} + virtual void unmap_neighbor_tiles(Device * /*sub_device*/, RenderTile * /*tiles*/) {} /* static */ static Device *create(DeviceInfo& info, Stats &stats, bool background = true); |