GPU Python: Implement gpu.texture.from_image

It can be useful to replace `image.bindcode` and `image.gl_load`.

Used for example in https://docs.blender.org/api/current/gpu.html#d-image

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D10458
This commit is contained in:
Germano Cavalcante
2021-03-01 17:35:10 -03:00
committed by Germano Cavalcante
parent f39143bc2e
commit 6c6b1c015c
4 changed files with 70 additions and 4 deletions

View File

@@ -73,6 +73,9 @@ PyObject *BPyInit_gpu(void)
PyModule_AddObject(mod, "state", (submodule = bpygpu_state_init()));
PyDict_SetItem(sys_modules, PyModule_GetNameObject(submodule), submodule);
PyModule_AddObject(mod, "texture", (submodule = bpygpu_texture_init()));
PyDict_SetItem(sys_modules, PyModule_GetNameObject(submodule), submodule);
return mod;
}