Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/device/queue.h
| Show All 13 Lines | |||||
| * limitations under the License. | * limitations under the License. | ||||
| */ | */ | ||||
| #pragma once | #pragma once | ||||
| #include "device/kernel.h" | #include "device/kernel.h" | ||||
| #include "device/graphics_interop.h" | #include "device/graphics_interop.h" | ||||
| #include "util/debug.h" | |||||
| #include "util/log.h" | #include "util/log.h" | ||||
| #include "util/map.h" | #include "util/map.h" | ||||
| #include "util/string.h" | #include "util/string.h" | ||||
| #include "util/unique_ptr.h" | #include "util/unique_ptr.h" | ||||
| CCL_NAMESPACE_BEGIN | CCL_NAMESPACE_BEGIN | ||||
| class Device; | class Device; | ||||
| class device_memory; | class device_memory; | ||||
| struct KernelWorkTile; | struct KernelWorkTile; | ||||
| /* Container for device kernel arguments with type correctness ensured by API. */ | /* Container for device kernel arguments with type correctness ensured by API. */ | ||||
| struct DeviceKernelArguments { | struct DeviceKernelArguments { | ||||
| enum Type { | enum Type { | ||||
| POINTER, | POINTER, | ||||
| INT32, | INT32, | ||||
| FLOAT32, | FLOAT32, | ||||
| BOOLEAN, | BOOLEAN, | ||||
| KERNEL_FILM_CONVERT, | KERNEL_FILM_CONVERT, | ||||
| }; | }; | ||||
| static const int MAX_ARGS = 16; | static const int MAX_ARGS = 18; | ||||
| Type types[MAX_ARGS]; | Type types[MAX_ARGS]; | ||||
| void *values[MAX_ARGS]; | void *values[MAX_ARGS]; | ||||
| size_t sizes[MAX_ARGS]; | size_t sizes[MAX_ARGS]; | ||||
| size_t count = 0; | size_t count = 0; | ||||
| DeviceKernelArguments() | DeviceKernelArguments() | ||||
| { | { | ||||
| } | } | ||||
| Show All 26 Lines | void add(const float *value) | ||||
| add(FLOAT32, value, sizeof(float)); | add(FLOAT32, value, sizeof(float)); | ||||
| } | } | ||||
| void add(const bool *value) | void add(const bool *value) | ||||
| { | { | ||||
| add(BOOLEAN, value, 4); | add(BOOLEAN, value, 4); | ||||
| } | } | ||||
| void add(const Type type, const void *value, size_t size) | void add(const Type type, const void *value, size_t size) | ||||
| { | { | ||||
| assert(count < MAX_ARGS); | |||||
| types[count] = type; | types[count] = type; | ||||
| values[count] = (void *)value; | values[count] = (void *)value; | ||||
| sizes[count] = size; | sizes[count] = size; | ||||
| count++; | count++; | ||||
| } | } | ||||
| template<typename T, typename... Args> void add(const T *first, Args... args) | template<typename T, typename... Args> void add(const T *first, Args... args) | ||||
| { | { | ||||
| add(first); | add(first); | ||||
| ▲ Show 20 Lines • Show All 88 Lines • Show Last 20 Lines | |||||