Python GPU: Add reference of PyObject GPU object to the GPU object itself

Instead of creating different python wrappers for the same GPU object,
return the same `PyObject` created earlier.

This also allows for more secure access to existing GPU objects.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D11044
This commit is contained in:
Germano Cavalcante
2021-04-29 14:48:59 -03:00
committed by Germano Cavalcante
parent c96506d54a
commit 04b6296e81
12 changed files with 143 additions and 25 deletions

View File

@@ -33,4 +33,5 @@ typedef struct BPyGPUTexture {
int bpygpu_ParseTexture(PyObject *o, void *p);
PyObject *bpygpu_texture_init(void);
PyObject *BPyGPUTexture_CreatePyObject(struct GPUTexture *tex) ATTR_NONNULL(1);
PyObject *BPyGPUTexture_CreatePyObject(struct GPUTexture *tex, bool weak_reference)
ATTR_NONNULL(1);