Blender
V4.5
intern
opensubdiv
internal
evaluator
evaluator_capi.cc
Go to the documentation of this file.
1
/* SPDX-FileCopyrightText: 2015 Blender Foundation
2
*
3
* SPDX-License-Identifier: GPL-2.0-or-later
4
*
5
* Author: Sergey Sharybin. */
6
7
#include "
opensubdiv_evaluator_capi.hh
"
8
9
#include <opensubdiv/osd/glslPatchShaderSource.h>
10
11
#include "
MEM_guardedalloc.h
"
12
13
#include "
internal/evaluator/evaluator_cache_impl.h
"
14
15
OpenSubdiv_EvaluatorCache
*
openSubdiv_createEvaluatorCache
(
eOpenSubdivEvaluator
evaluator_type)
16
{
17
OpenSubdiv_EvaluatorCache
*evaluator_cache = MEM_new<OpenSubdiv_EvaluatorCache>(__func__);
18
evaluator_cache->
impl
=
openSubdiv_createEvaluatorCacheInternal
(evaluator_type);
19
return
evaluator_cache;
20
}
21
22
void
openSubdiv_deleteEvaluatorCache
(
OpenSubdiv_EvaluatorCache
*evaluator_cache)
23
{
24
if
(!evaluator_cache) {
25
return
;
26
}
27
28
openSubdiv_deleteEvaluatorCacheInternal
(evaluator_cache->
impl
);
29
MEM_delete(evaluator_cache);
30
}
31
32
const
char
*
openSubdiv_getGLSLPatchBasisSource
()
33
{
34
/* Using a global string to avoid dealing with memory allocation/ownership. */
35
static
std::string patch_basis_source;
36
if
(patch_basis_source.empty()) {
37
patch_basis_source = OpenSubdiv::Osd::GLSLPatchShaderSource::GetPatchBasisShaderSource();
38
}
39
return
patch_basis_source.c_str();
40
}
MEM_guardedalloc.h
Read Guarded memory(de)allocation.
openSubdiv_createEvaluatorCacheInternal
OpenSubdiv_EvaluatorCacheImpl * openSubdiv_createEvaluatorCacheInternal(eOpenSubdivEvaluator evaluator_type)
Definition
evaluator_cache_impl.cc:16
openSubdiv_deleteEvaluatorCacheInternal
void openSubdiv_deleteEvaluatorCacheInternal(OpenSubdiv_EvaluatorCacheImpl *evaluator_cache)
Definition
evaluator_cache_impl.cc:30
evaluator_cache_impl.h
openSubdiv_deleteEvaluatorCache
void openSubdiv_deleteEvaluatorCache(OpenSubdiv_EvaluatorCache *evaluator_cache)
Definition
evaluator_capi.cc:22
openSubdiv_getGLSLPatchBasisSource
const char * openSubdiv_getGLSLPatchBasisSource()
Definition
evaluator_capi.cc:32
openSubdiv_createEvaluatorCache
OpenSubdiv_EvaluatorCache * openSubdiv_createEvaluatorCache(eOpenSubdivEvaluator evaluator_type)
Definition
evaluator_capi.cc:15
eOpenSubdivEvaluator
eOpenSubdivEvaluator
Definition
opensubdiv_capi_type.hh:7
opensubdiv_evaluator_capi.hh
OpenSubdiv_EvaluatorCache
Definition
opensubdiv_evaluator_capi.hh:22
OpenSubdiv_EvaluatorCache::impl
OpenSubdiv_EvaluatorCacheImpl * impl
Definition
opensubdiv_evaluator_capi.hh:24
Generated on
for Blender by
doxygen
1.16.1