diff options
author | Germano Cavalcante <mano-wii> | 2022-04-13 00:28:27 +0300 |
---|---|---|
committer | Germano Cavalcante <germano.costa@ig.com.br> | 2022-04-13 00:50:56 +0300 |
commit | 9bc678969aaef5e2343d9362648e9a633d1b6e5e (patch) | |
tree | 6967bc7469d26d91925bddc618d4ad69432d12fc /source/blender/python/gpu/gpu_py_types.c | |
parent | 359b6baf325a701328732598ecc04b68a9a335d9 (diff) |
pyGPU: Port 'StageInterfaceInfo' and 'ShaderCreateInfo' types
In order to allow GLSL Cross Compilation across platforms, expose in
Python the `GPUShaderCreateInfo` strategy as detailed in
https://wiki.blender.org/wiki/EEVEE_%26_Viewport/GPU_Module/GLSL_Cross_Compilation
The new features can be listed as follows:
```
>>> gpu.types.GPUShaderCreateInfo.
define(
fragment_out(
fragment_source(
push_constant(
sampler(
typedef_source(
uniform_buf(
vertex_in(
vertex_out(
vertex_source(
>>> gpu.types.GPUStageInterfaceInfo.
flat(
name
no_perspective(
smooth(
>>> gpu.shader.create_from_info(
```
Reviewed By: fclem, campbellbarton
Differential Revision: https://developer.blender.org/D14497
Diffstat (limited to 'source/blender/python/gpu/gpu_py_types.c')
-rw-r--r-- | source/blender/python/gpu/gpu_py_types.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/python/gpu/gpu_py_types.c b/source/blender/python/gpu/gpu_py_types.c index 6dff70ad530..65201df4a9e 100644 --- a/source/blender/python/gpu/gpu_py_types.c +++ b/source/blender/python/gpu/gpu_py_types.c @@ -59,6 +59,12 @@ PyObject *bpygpu_types_init(void) if (PyType_Ready(&BPyGPUUniformBuf_Type) < 0) { return NULL; } + if (PyType_Ready(&BPyGPUShaderCreateInfo_Type) < 0) { + return NULL; + } + if (PyType_Ready(&BPyGPUStageInterfaceInfo_Type) < 0) { + return NULL; + } PyModule_AddType(submodule, &BPyGPU_BufferType); PyModule_AddType(submodule, &BPyGPUVertFormat_Type); @@ -70,6 +76,8 @@ PyObject *bpygpu_types_init(void) PyModule_AddType(submodule, &BPyGPUTexture_Type); PyModule_AddType(submodule, &BPyGPUFrameBuffer_Type); PyModule_AddType(submodule, &BPyGPUUniformBuf_Type); + PyModule_AddType(submodule, &BPyGPUShaderCreateInfo_Type); + PyModule_AddType(submodule, &BPyGPUStageInterfaceInfo_Type); return submodule; } |