2011-09-09 11:55:38 +00:00
|
|
|
/*
|
2011-11-29 10:54:47 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
2011-09-09 11:55:38 +00:00
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
2011-11-29 10:54:47 +00:00
|
|
|
* of the License, or (at your option) any later version.
|
2011-09-09 11:55:38 +00:00
|
|
|
*
|
2011-11-29 10:54:47 +00:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
2011-09-09 11:55:38 +00:00
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2011-11-29 10:54:47 +00:00
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
2011-09-09 11:55:38 +00:00
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
|
*/
|
|
|
|
|
|
2019-02-18 08:08:12 +11:00
|
|
|
/** \file
|
|
|
|
|
* \ingroup bpygpu
|
2011-09-09 11:55:38 +00:00
|
|
|
*/
|
2013-09-19 23:17:52 +00:00
|
|
|
|
2020-08-07 09:50:34 +02:00
|
|
|
#pragma once
|
2018-09-05 21:10:42 -03:00
|
|
|
|
|
|
|
|
#include "BLI_compiler_attrs.h"
|
|
|
|
|
|
|
|
|
|
#define USE_GPU_PY_REFERENCES
|
|
|
|
|
|
|
|
|
|
extern PyTypeObject BPyGPUBatch_Type;
|
|
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
#define BPyGPUBatch_Check(v) (Py_TYPE(v) == &BPyGPUBatch_Type)
|
2013-09-19 23:17:52 +00:00
|
|
|
|
2018-09-05 21:10:42 -03:00
|
|
|
typedef struct BPyGPUBatch {
|
2019-05-03 18:09:04 +10:00
|
|
|
PyObject_VAR_HEAD
|
|
|
|
|
/* The batch is owned, we may support thin wrapped batches later. */
|
|
|
|
|
struct GPUBatch *batch;
|
2018-09-05 21:10:42 -03:00
|
|
|
#ifdef USE_GPU_PY_REFERENCES
|
2019-04-17 06:17:24 +02:00
|
|
|
/* Just to keep a user to prevent freeing buf's we're using */
|
|
|
|
|
PyObject *references;
|
2018-09-05 21:10:42 -03:00
|
|
|
#endif
|
|
|
|
|
} BPyGPUBatch;
|
2011-09-09 11:55:38 +00:00
|
|
|
|
2018-09-05 21:10:42 -03:00
|
|
|
PyObject *BPyGPUBatch_CreatePyObject(struct GPUBatch *batch) ATTR_NONNULL(1);
|