diff options
author | Patrick Mours <pmours@nvidia.com> | 2022-09-08 20:31:44 +0300 |
---|---|---|
committer | Patrick Mours <pmours@nvidia.com> | 2022-09-09 16:47:37 +0300 |
commit | 8611c37f975737efe0d159822edfc21733268f51 (patch) | |
tree | e7d7ce6b36fe7008c26b9fee5d90f906fe4faf5c /intern/cycles/kernel/osl/types.h | |
parent | ef7c9e793ec5331ac694eec9336565bd2254c406 (diff) |
Cycles: Generate OSL closures using macros and a template file
This has the advantage of being able to use information about the
existing OSL closures in various places without code duplication. In
addition, the setup code for all closures was moved to standalone
functions to avoid usage of virtual function calls in preparation for GPU
support.
This patch was split from D15902.
Differential Revision: https://developer.blender.org/D15917
Diffstat (limited to 'intern/cycles/kernel/osl/types.h')
-rw-r--r-- | intern/cycles/kernel/osl/types.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/intern/cycles/kernel/osl/types.h b/intern/cycles/kernel/osl/types.h new file mode 100644 index 00000000000..14feb16aad4 --- /dev/null +++ b/intern/cycles/kernel/osl/types.h @@ -0,0 +1,21 @@ +/* SPDX-License-Identifier: Apache-2.0 + * Copyright 2011-2022 Blender Foundation */ + +#pragma once + +CCL_NAMESPACE_BEGIN + +/* Closure */ + +enum ClosureTypeOSL { + OSL_CLOSURE_MUL_ID = -1, + OSL_CLOSURE_ADD_ID = -2, + + OSL_CLOSURE_NONE_ID = 0, + +#define OSL_CLOSURE_STRUCT_BEGIN(Upper, lower) OSL_CLOSURE_##Upper##_ID, +#include "closures_template.h" +}; + + +CCL_NAMESPACE_END |