Blender  V2.93
device_dummy.cpp
Go to the documentation of this file.
1 /*
2  * Copyright 2011-2020 Blender Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #include "device/device.h"
18 #include "device/device_intern.h"
19 
21 
22 /* Dummy device for when creating an appropriate rendering device fails. */
23 
24 class DummyDevice : public Device {
25  public:
26  DummyDevice(DeviceInfo &info_, Stats &stats_, Profiler &profiler_, bool background_)
27  : Device(info_, stats_, profiler_, background_)
28  {
30  }
31 
33  {
34  }
35 
36  virtual BVHLayoutMask get_bvh_layout_mask() const override
37  {
38  return 0;
39  }
40 
41  virtual void mem_alloc(device_memory &) override
42  {
43  }
44 
45  virtual void mem_copy_to(device_memory &) override
46  {
47  }
48 
49  virtual void mem_copy_from(device_memory &, int, int, int, int) override
50  {
51  }
52 
53  virtual void mem_zero(device_memory &) override
54  {
55  }
56 
57  virtual void mem_free(device_memory &) override
58  {
59  }
60 
61  virtual void const_copy_to(const char *, void *, size_t) override
62  {
63  }
64 
65  virtual void task_add(DeviceTask &) override
66  {
67  }
68 
69  virtual void task_wait() override
70  {
71  }
72 
73  virtual void task_cancel() override
74  {
75  }
76 };
77 
78 Device *device_dummy_create(DeviceInfo &info, Stats &stats, Profiler &profiler, bool background)
79 {
80  return new DummyDevice(info, stats, profiler, background);
81 }
82 
int BVHLayoutMask
Definition: bvh_params.h:39
string error_msg
Definition: device.h:92
Definition: device.h:293
string error_msg
Definition: device.h:315
DeviceInfo info
Definition: device.h:337
virtual void mem_copy_from(device_memory &, int, int, int, int) override
virtual void mem_free(device_memory &) override
virtual void const_copy_to(const char *, void *, size_t) override
virtual void mem_alloc(device_memory &) override
virtual void task_add(DeviceTask &) override
virtual void task_cancel() override
virtual BVHLayoutMask get_bvh_layout_mask() const override
DummyDevice(DeviceInfo &info_, Stats &stats_, Profiler &profiler_, bool background_)
virtual void mem_zero(device_memory &) override
virtual void task_wait() override
virtual void mem_copy_to(device_memory &) override
Device * device_dummy_create(DeviceInfo &info, Stats &stats, Profiler &profiler, bool background)
#define CCL_NAMESPACE_END