From 30887fc387e8b86fa97fbd64141993950124f0a7 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 10 May 2019 23:32:58 +0200 Subject: Cycles: add function to clear resumable chunk --- intern/cycles/blender/blender_python.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'intern/cycles/blender/blender_python.cpp') diff --git a/intern/cycles/blender/blender_python.cpp b/intern/cycles/blender/blender_python.cpp index ffd1c70a4e4..3ab8c8bd6d9 100644 --- a/intern/cycles/blender/blender_python.cpp +++ b/intern/cycles/blender/blender_python.cpp @@ -937,6 +937,15 @@ static PyObject *set_resumable_chunk_range_func(PyObject * /*self*/, PyObject *a Py_RETURN_NONE; } +static PyObject *clear_resumable_chunk_func(PyObject * /*self*/, PyObject * /*value*/) +{ + VLOG(1) << "Clear resumable render"; + BlenderSession::num_resumable_chunks = 0; + BlenderSession::current_resumable_chunk = 0; + + Py_RETURN_NONE; +} + static PyObject *enable_print_stats_func(PyObject * /*self*/, PyObject * /*args*/) { BlenderSession::print_render_stats = true; @@ -992,6 +1001,7 @@ static PyMethodDef methods[] = { /* Resumable render */ {"set_resumable_chunk", set_resumable_chunk_func, METH_VARARGS, ""}, {"set_resumable_chunk_range", set_resumable_chunk_range_func, METH_VARARGS, ""}, + {"clear_resumable_chunk", clear_resumable_chunk_func, METH_NOARGS, ""}, /* Compute Device selection */ {"get_device_types", get_device_types_func, METH_VARARGS, ""}, -- cgit v1.2.3 From 6529d20d79a5e55696a2fa48150055d3e4a942dd Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 12 Jun 2019 09:04:10 +1000 Subject: Cleanup: spelling in comments --- intern/cycles/blender/blender_python.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'intern/cycles/blender/blender_python.cpp') diff --git a/intern/cycles/blender/blender_python.cpp b/intern/cycles/blender/blender_python.cpp index 3ab8c8bd6d9..80c6fee9723 100644 --- a/intern/cycles/blender/blender_python.cpp +++ b/intern/cycles/blender/blender_python.cpp @@ -138,7 +138,7 @@ static const char *PyC_UnicodeAsByte(PyObject *py_str, PyObject **coerce) const char *result = _PyUnicode_AsString(py_str); if (result) { /* 99% of the time this is enough but we better support non unicode - * chars since blender doesnt limit this. + * chars since blender doesn't limit this. */ return result; } @@ -151,7 +151,7 @@ static const char *PyC_UnicodeAsByte(PyObject *py_str, PyObject **coerce) return PyBytes_AS_STRING(*coerce); } else { - /* Clear the error, so Cycles can be at leadt used without + /* Clear the error, so Cycles can be at least used without * GPU and OSL support, */ PyErr_Clear(); -- cgit v1.2.3 From b9ed30c25c703c479dddab1ad6fec2adba558335 Mon Sep 17 00:00:00 2001 From: Jeroen Bakker Date: Thu, 29 Aug 2019 12:32:27 +0200 Subject: Cycles: OpenCL Separate Compilation Debug Flag OpenCL Parallel compilation only works inside Blender. When using cycles in a different setup (standaline or other software) it failed compiling kernels as they don't have the appropriate Python API and command line arguments. This change introduces a `running_inside_blender` debug flag, that triggers out of process compilation of the kernels. Compilation still happens in subthread that enabled the preview kernels and compilation of the kernels during BVH building Reviewed By: brecht Differential Revision: https://developer.blender.org/D5439 --- intern/cycles/blender/blender_python.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'intern/cycles/blender/blender_python.cpp') diff --git a/intern/cycles/blender/blender_python.cpp b/intern/cycles/blender/blender_python.cpp index 80c6fee9723..9753da71eb4 100644 --- a/intern/cycles/blender/blender_python.cpp +++ b/intern/cycles/blender/blender_python.cpp @@ -177,6 +177,8 @@ static PyObject *init_func(PyObject * /*self*/, PyObject *args) BlenderSession::headless = headless; + DebugFlags().running_inside_blender = true; + VLOG(2) << "Debug flags initialized to:\n" << DebugFlags(); Py_RETURN_NONE; -- cgit v1.2.3 From 861697c9e55bad362fc493e263fe966095744b37 Mon Sep 17 00:00:00 2001 From: Jeroen Bakker Date: Wed, 11 Sep 2019 08:22:53 +0200 Subject: Cycles: Initial Support For Local View This diff will add support for local view to Cycles rendered preview mode. Currently the implementation shows same results as EEVEE does. This entails a difference with Blender 2.79, where lights were automatically added to the local view. {T69780} describes this should be solved before the next release. This patch also solves missing `owner_id` issues when using the RNA CPP Api from Cycles. Cycles didn't provide the `owner_id` making some functionality fail, what then was worked around in Blender. It also fixes an issue in `makesrna` where incorrect CPP code was generated when only `PARM_RNAPTR` was provided. An optional `view_layer` parameter is added to the `Object.local_view_get` method to reduce lookups. Reviewed By: brecht Differential Revision: https://developer.blender.org/D5753 --- intern/cycles/blender/blender_python.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'intern/cycles/blender/blender_python.cpp') diff --git a/intern/cycles/blender/blender_python.cpp b/intern/cycles/blender/blender_python.cpp index 9753da71eb4..2bea6b34772 100644 --- a/intern/cycles/blender/blender_python.cpp +++ b/intern/cycles/blender/blender_python.cpp @@ -194,14 +194,15 @@ static PyObject *exit_func(PyObject * /*self*/, PyObject * /*args*/) static PyObject *create_func(PyObject * /*self*/, PyObject *args) { - PyObject *pyengine, *pypreferences, *pydata, *pyregion, *pyv3d, *pyrv3d; + PyObject *pyengine, *pypreferences, *pydata, *pyscreen, *pyregion, *pyv3d, *pyrv3d; int preview_osl; if (!PyArg_ParseTuple(args, - "OOOOOOi", + "OOOOOOOi", &pyengine, &pypreferences, &pydata, + &pyscreen, &pyregion, &pyv3d, &pyrv3d, @@ -210,6 +211,8 @@ static PyObject *create_func(PyObject * /*self*/, PyObject *args) } /* RNA */ + ID *bScreen = (ID *)PyLong_AsVoidPtr(pyscreen); + PointerRNA engineptr; RNA_pointer_create(NULL, &RNA_RenderEngine, (void *)PyLong_AsVoidPtr(pyengine), &engineptr); BL::RenderEngine engine(engineptr); @@ -224,15 +227,15 @@ static PyObject *create_func(PyObject * /*self*/, PyObject *args) BL::BlendData data(dataptr); PointerRNA regionptr; - RNA_pointer_create(NULL, &RNA_Region, pylong_as_voidptr_typesafe(pyregion), ®ionptr); + RNA_pointer_create(bScreen, &RNA_Region, pylong_as_voidptr_typesafe(pyregion), ®ionptr); BL::Region region(regionptr); PointerRNA v3dptr; - RNA_pointer_create(NULL, &RNA_SpaceView3D, pylong_as_voidptr_typesafe(pyv3d), &v3dptr); + RNA_pointer_create(bScreen, &RNA_SpaceView3D, pylong_as_voidptr_typesafe(pyv3d), &v3dptr); BL::SpaceView3D v3d(v3dptr); PointerRNA rv3dptr; - RNA_pointer_create(NULL, &RNA_RegionView3D, pylong_as_voidptr_typesafe(pyrv3d), &rv3dptr); + RNA_pointer_create(bScreen, &RNA_RegionView3D, pylong_as_voidptr_typesafe(pyrv3d), &rv3dptr); BL::RegionView3D rv3d(rv3dptr); /* create session */ -- cgit v1.2.3 From a2b52dc5716a97e5413acbd6eefc9ce3788b6456 Mon Sep 17 00:00:00 2001 From: Patrick Mours Date: Thu, 12 Sep 2019 14:50:06 +0200 Subject: Cycles: add Optix device backend This uses hardware-accelerated raytracing on NVIDIA RTX graphics cards. It is still currently experimental. Most features are supported, but a few are still missing like baking, branched path tracing and using CPU memory. https://wiki.blender.org/wiki/Reference/Release_Notes/2.81/Cycles#NVIDIA_RTX For building with Optix support, the Optix SDK must be installed. See here for build instructions: https://wiki.blender.org/wiki/Building_Blender/CUDA Differential Revision: https://developer.blender.org/D5363 --- intern/cycles/blender/blender_python.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'intern/cycles/blender/blender_python.cpp') diff --git a/intern/cycles/blender/blender_python.cpp b/intern/cycles/blender/blender_python.cpp index 2bea6b34772..335d4daf09c 100644 --- a/intern/cycles/blender/blender_python.cpp +++ b/intern/cycles/blender/blender_python.cpp @@ -81,6 +81,8 @@ bool debug_flags_sync_from_scene(BL::Scene b_scene) /* Synchronize CUDA flags. */ flags.cuda.adaptive_compile = get_boolean(cscene, "debug_use_cuda_adaptive_compile"); flags.cuda.split_kernel = get_boolean(cscene, "debug_use_cuda_split_kernel"); + /* Synchronize OptiX flags. */ + flags.optix.cuda_streams = get_int(cscene, "debug_optix_cuda_streams"); /* Synchronize OpenCL device type. */ switch (get_enum(cscene, "debug_opencl_device_type")) { case 0: @@ -960,14 +962,16 @@ static PyObject *enable_print_stats_func(PyObject * /*self*/, PyObject * /*args* static PyObject *get_device_types_func(PyObject * /*self*/, PyObject * /*args*/) { vector device_types = Device::available_types(); - bool has_cuda = false, has_opencl = false; + bool has_cuda = false, has_optix = false, has_opencl = false; foreach (DeviceType device_type, device_types) { has_cuda |= (device_type == DEVICE_CUDA); + has_optix |= (device_type == DEVICE_OPTIX); has_opencl |= (device_type == DEVICE_OPENCL); } - PyObject *list = PyTuple_New(2); + PyObject *list = PyTuple_New(3); PyTuple_SET_ITEM(list, 0, PyBool_FromLong(has_cuda)); - PyTuple_SET_ITEM(list, 1, PyBool_FromLong(has_opencl)); + PyTuple_SET_ITEM(list, 1, PyBool_FromLong(has_optix)); + PyTuple_SET_ITEM(list, 2, PyBool_FromLong(has_opencl)); return list; } -- cgit v1.2.3 From 47402dcb9160793fcfd87ea3c6e6685ea6954b3f Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sun, 2 Feb 2020 13:09:18 +0100 Subject: Cleanup: split Cycles export into smaller files --- intern/cycles/blender/blender_python.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'intern/cycles/blender/blender_python.cpp') diff --git a/intern/cycles/blender/blender_python.cpp b/intern/cycles/blender/blender_python.cpp index 335d4daf09c..816b4552fff 100644 --- a/intern/cycles/blender/blender_python.cpp +++ b/intern/cycles/blender/blender_python.cpp @@ -21,6 +21,7 @@ #include "blender/blender_device.h" #include "blender/blender_sync.h" #include "blender/blender_session.h" +#include "blender/blender_util.h" #include "render/denoising.h" #include "render/merge.h" -- cgit v1.2.3 From 2d1cce8331f3ecdfb8cb0c651e111ffac5dc7153 Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Thu, 19 Mar 2020 09:33:03 +0100 Subject: Cleanup: `make format` after SortedIncludes change --- intern/cycles/blender/blender_python.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'intern/cycles/blender/blender_python.cpp') diff --git a/intern/cycles/blender/blender_python.cpp b/intern/cycles/blender/blender_python.cpp index 816b4552fff..89bcebda193 100644 --- a/intern/cycles/blender/blender_python.cpp +++ b/intern/cycles/blender/blender_python.cpp @@ -19,8 +19,8 @@ #include "blender/CCL_api.h" #include "blender/blender_device.h" -#include "blender/blender_sync.h" #include "blender/blender_session.h" +#include "blender/blender_sync.h" #include "blender/blender_util.h" #include "render/denoising.h" @@ -38,8 +38,8 @@ #ifdef WITH_OSL # include "render/osl.h" -# include # include +# include #endif #ifdef WITH_OPENCL -- cgit v1.2.3 From ac6be6759ecc6c6503e8785ee405c003e0ca2fe5 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 4 May 2020 20:02:08 +0200 Subject: Fix Cycles Python error when device name is not a valid UTF-8 string This may fix or help diagnose T76378. --- intern/cycles/blender/blender_python.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'intern/cycles/blender/blender_python.cpp') diff --git a/intern/cycles/blender/blender_python.cpp b/intern/cycles/blender/blender_python.cpp index 89bcebda193..8c7c0bc1daa 100644 --- a/intern/cycles/blender/blender_python.cpp +++ b/intern/cycles/blender/blender_python.cpp @@ -60,6 +60,12 @@ void *pylong_as_voidptr_typesafe(PyObject *object) return PyLong_AsVoidPtr(object); } +PyObject *pyunicode_from_string(const char *str) +{ + /* Ignore errors if device API returns invalid UTF-8 strings. */ + return PyUnicode_DecodeUTF8(str, strlen(str), "ignore"); +} + /* Synchronize debug flags from a given Blender scene. * Return truth when device list needs invalidation. */ @@ -429,9 +435,9 @@ static PyObject *available_devices_func(PyObject * /*self*/, PyObject *args) DeviceInfo &device = devices[i]; string type_name = Device::string_from_type(device.type); PyObject *device_tuple = PyTuple_New(3); - PyTuple_SET_ITEM(device_tuple, 0, PyUnicode_FromString(device.description.c_str())); - PyTuple_SET_ITEM(device_tuple, 1, PyUnicode_FromString(type_name.c_str())); - PyTuple_SET_ITEM(device_tuple, 2, PyUnicode_FromString(device.id.c_str())); + PyTuple_SET_ITEM(device_tuple, 0, pyunicode_from_string(device.description.c_str())); + PyTuple_SET_ITEM(device_tuple, 1, pyunicode_from_string(type_name.c_str())); + PyTuple_SET_ITEM(device_tuple, 2, pyunicode_from_string(device.id.c_str())); PyTuple_SET_ITEM(ret, i, device_tuple); } @@ -642,7 +648,7 @@ static PyObject *osl_compile_func(PyObject * /*self*/, PyObject *args) static PyObject *system_info_func(PyObject * /*self*/, PyObject * /*value*/) { string system_info = Device::device_capabilities(); - return PyUnicode_FromString(system_info.c_str()); + return pyunicode_from_string(system_info.c_str()); } #ifdef WITH_OPENCL -- cgit v1.2.3 From d9773edaa394f61393f9c8b80275e62f74306097 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 10 May 2019 21:39:58 +0200 Subject: Cycles: code refactor to bake using regular render session and tiles There should be no user visible change from this, except that tile size now affects performance. The goal here is to simplify bake denoising in D3099, letting it reuse more denoising tiles and pass code. A lot of code is now shared with regular rendering, with the two main differences being that we read some render result passes from the bake API when starting to render a tile, and call the bake kernel instead of the path trace kernel. With this kind of design where Cycles asks for tiles from the bake API, it should eventually be easier to reduce memory usage, show tiles as they are baked, or bake multiple passes at once, though there's still quite some work needed for that. Reviewers: #cycles Subscribers: monio, wmatyjewicz, lukasstockner97, michaelknubben Differential Revision: https://developer.blender.org/D3108 --- intern/cycles/blender/blender_python.cpp | 28 +++++----------------------- 1 file changed, 5 insertions(+), 23 deletions(-) (limited to 'intern/cycles/blender/blender_python.cpp') diff --git a/intern/cycles/blender/blender_python.cpp b/intern/cycles/blender/blender_python.cpp index 8c7c0bc1daa..79c16856462 100644 --- a/intern/cycles/blender/blender_python.cpp +++ b/intern/cycles/blender/blender_python.cpp @@ -298,22 +298,18 @@ static PyObject *render_func(PyObject * /*self*/, PyObject *args) static PyObject *bake_func(PyObject * /*self*/, PyObject *args) { PyObject *pysession, *pydepsgraph, *pyobject; - PyObject *pypixel_array, *pyresult; const char *pass_type; - int num_pixels, depth, object_id, pass_filter; + int pass_filter, width, height; if (!PyArg_ParseTuple(args, - "OOOsiiOiiO", + "OOOsiii", &pysession, &pydepsgraph, &pyobject, &pass_type, &pass_filter, - &object_id, - &pypixel_array, - &num_pixels, - &depth, - &pyresult)) + &width, + &height)) return NULL; BlenderSession *session = (BlenderSession *)PyLong_AsVoidPtr(pysession); @@ -326,23 +322,9 @@ static PyObject *bake_func(PyObject * /*self*/, PyObject *args) RNA_id_pointer_create((ID *)PyLong_AsVoidPtr(pyobject), &objectptr); BL::Object b_object(objectptr); - void *b_result = PyLong_AsVoidPtr(pyresult); - - PointerRNA bakepixelptr; - RNA_pointer_create(NULL, &RNA_BakePixel, PyLong_AsVoidPtr(pypixel_array), &bakepixelptr); - BL::BakePixel b_bake_pixel(bakepixelptr); - python_thread_state_save(&session->python_thread_state); - session->bake(b_depsgraph, - b_object, - pass_type, - pass_filter, - object_id, - b_bake_pixel, - (size_t)num_pixels, - depth, - (float *)b_result); + session->bake(b_depsgraph, b_object, pass_type, pass_filter, width, height); python_thread_state_restore(&session->python_thread_state); -- cgit v1.2.3 From 9f7d84b656fbb56966620ecc249ce5bc7089a1d1 Mon Sep 17 00:00:00 2001 From: Patrick Mours Date: Mon, 8 Jun 2020 17:16:10 +0200 Subject: Cycles: Add support for P2P memory distribution (e.g. via NVLink) This change modifies the multi-device implementation to support memory distribution across devices, to reduce the overall memory footprint of large scenes and allow scenes to fit entirely into combined GPU memory that previously had to fall back to host memory. Reviewed By: brecht Differential Revision: https://developer.blender.org/D7426 --- intern/cycles/blender/blender_python.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'intern/cycles/blender/blender_python.cpp') diff --git a/intern/cycles/blender/blender_python.cpp b/intern/cycles/blender/blender_python.cpp index 79c16856462..0be19dbffd1 100644 --- a/intern/cycles/blender/blender_python.cpp +++ b/intern/cycles/blender/blender_python.cpp @@ -416,10 +416,11 @@ static PyObject *available_devices_func(PyObject * /*self*/, PyObject *args) for (size_t i = 0; i < devices.size(); i++) { DeviceInfo &device = devices[i]; string type_name = Device::string_from_type(device.type); - PyObject *device_tuple = PyTuple_New(3); + PyObject *device_tuple = PyTuple_New(4); PyTuple_SET_ITEM(device_tuple, 0, pyunicode_from_string(device.description.c_str())); PyTuple_SET_ITEM(device_tuple, 1, pyunicode_from_string(type_name.c_str())); PyTuple_SET_ITEM(device_tuple, 2, pyunicode_from_string(device.id.c_str())); + PyTuple_SET_ITEM(device_tuple, 3, PyBool_FromLong(device.has_peer_memory)); PyTuple_SET_ITEM(ret, i, device_tuple); } -- cgit v1.2.3 From ace3268482c6bfd9986815aaa6b027c99fa8e3f4 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 5 Jun 2020 11:39:11 +0200 Subject: Cleanup: minor refactoring around DeviceTask --- intern/cycles/blender/blender_python.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'intern/cycles/blender/blender_python.cpp') diff --git a/intern/cycles/blender/blender_python.cpp b/intern/cycles/blender/blender_python.cpp index 0be19dbffd1..5595d657640 100644 --- a/intern/cycles/blender/blender_python.cpp +++ b/intern/cycles/blender/blender_python.cpp @@ -33,6 +33,7 @@ #include "util/util_opengl.h" #include "util/util_path.h" #include "util/util_string.h" +#include "util/util_task.h" #include "util/util_types.h" #ifdef WITH_OSL -- cgit v1.2.3 From 669befdfbe487f76c65f54e3da0013d140d56893 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 1 Jun 2020 00:11:17 +0200 Subject: Cycles: add Intel OpenImageDenoise support for viewport denoising Compared to Optix denoise, this is usually slower since there is no GPU acceleration. Some optimizations may still be possible, in avoid copies to the GPU and/or denoising less often. The main thing is that this adds viewport denoising support for computers without an NVIDIA GPU (as long as the CPU supports SSE 4.1, which is nearly all of them). Ref T76259 --- intern/cycles/blender/blender_python.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'intern/cycles/blender/blender_python.cpp') diff --git a/intern/cycles/blender/blender_python.cpp b/intern/cycles/blender/blender_python.cpp index 5595d657640..3e595c3ee52 100644 --- a/intern/cycles/blender/blender_python.cpp +++ b/intern/cycles/blender/blender_python.cpp @@ -31,6 +31,7 @@ #include "util/util_logging.h" #include "util/util_md5.h" #include "util/util_opengl.h" +#include "util/util_openimagedenoise.h" #include "util/util_path.h" #include "util/util_string.h" #include "util/util_task.h" @@ -1076,5 +1077,14 @@ void *CCL_python_module_init() Py_INCREF(Py_False); #endif /* WITH_EMBREE */ + if (ccl::openimagedenoise_supported()) { + PyModule_AddObject(mod, "with_openimagedenoise", Py_True); + Py_INCREF(Py_True); + } + else { + PyModule_AddObject(mod, "with_openimagedenoise", Py_False); + Py_INCREF(Py_False); + } + return (void *)mod; } -- cgit v1.2.3 From 737bd549b6eeee81f0573ad8e305fb8d888d82ec Mon Sep 17 00:00:00 2001 From: Patrick Mours Date: Mon, 6 Jul 2020 12:25:54 +0200 Subject: Cycles: Add support for native OptiX curve primitive This patch adds support for the curve primitive from OptiX to Cycles. It's currently hidden behind a debug option, since there can be some slight rendering differences still (because no backface culling is performed and something seems off with endcaps). The curve primitive was added with the OptiX 7.1 SDK and requires a r450 driver or newer, so this also updates the codebase to be able to build with the new SDK. Reviewed By: brecht Differential Revision: https://developer.blender.org/D8223 --- intern/cycles/blender/blender_python.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'intern/cycles/blender/blender_python.cpp') diff --git a/intern/cycles/blender/blender_python.cpp b/intern/cycles/blender/blender_python.cpp index 3e595c3ee52..25c77b74ce3 100644 --- a/intern/cycles/blender/blender_python.cpp +++ b/intern/cycles/blender/blender_python.cpp @@ -92,6 +92,7 @@ bool debug_flags_sync_from_scene(BL::Scene b_scene) flags.cuda.split_kernel = get_boolean(cscene, "debug_use_cuda_split_kernel"); /* Synchronize OptiX flags. */ flags.optix.cuda_streams = get_int(cscene, "debug_optix_cuda_streams"); + flags.optix.curves_api = get_boolean(cscene, "debug_optix_curves_api"); /* Synchronize OpenCL device type. */ switch (get_enum(cscene, "debug_opencl_device_type")) { case 0: -- cgit v1.2.3