Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGermano Cavalcante <mano-wii>2022-04-19 17:15:22 +0300
committerGermano Cavalcante <germano.costa@ig.com.br>2022-04-19 17:23:51 +0300
commit3e98331a094b0bc7f6bf8d386e610e06bfa4e61b (patch)
tree6064d5095b8a20c4bbc051c3a00e8cfbedfadfc8 /source/blender/gpu
parent47de3659f034d203ed208784e48e91f4cbe80373 (diff)
PyGPU: remove outdated function 'code_from_builtin'
Since shader sources are now parsed on demand via `GPUShaderCreateInfo`, sources are not available to be read via `GPU_shader_get_builtin_shader_code`. Currently this results in a crash as the code tries to read `NULL` pointers. `GPU_shader_get_builtin_shader_code` was created with the intention of informing the user how a builtin shader works, thus "replacing" detailed documentation. Therefore this function doesn't really have a practical use in an addon. So, instead of updating the function (which would require several changes to the gpu module), remove it and improve the documentation. Release Notes: https://wiki.blender.org/wiki/Reference/Release_Notes/3.2/Python_API#Breaking_Changes Reviewed By: fclem Differential Revision: https://developer.blender.org/D14678
Diffstat (limited to 'source/blender/gpu')
-rw-r--r--source/blender/gpu/GPU_shader.h6
-rw-r--r--source/blender/gpu/intern/gpu_shader_builtin.c13
2 files changed, 0 insertions, 19 deletions
diff --git a/source/blender/gpu/GPU_shader.h b/source/blender/gpu/GPU_shader.h
index eed7685bf01..0e7ce0889c2 100644
--- a/source/blender/gpu/GPU_shader.h
+++ b/source/blender/gpu/GPU_shader.h
@@ -371,12 +371,6 @@ GPUShader *GPU_shader_get_builtin_shader_with_config(eGPUBuiltinShader shader,
eGPUShaderConfig sh_cfg);
GPUShader *GPU_shader_get_builtin_shader(eGPUBuiltinShader shader);
-void GPU_shader_get_builtin_shader_code(eGPUBuiltinShader shader,
- const char **r_vert,
- const char **r_frag,
- const char **r_geom,
- const char **r_defines);
-
void GPU_shader_free_builtin_shaders(void);
/* Vertex attributes for shaders */
diff --git a/source/blender/gpu/intern/gpu_shader_builtin.c b/source/blender/gpu/intern/gpu_shader_builtin.c
index dfedb64ce61..1958ecedb28 100644
--- a/source/blender/gpu/intern/gpu_shader_builtin.c
+++ b/source/blender/gpu/intern/gpu_shader_builtin.c
@@ -402,19 +402,6 @@ GPUShader *GPU_shader_get_builtin_shader(eGPUBuiltinShader shader)
return GPU_shader_get_builtin_shader_with_config(shader, GPU_SHADER_CFG_DEFAULT);
}
-void GPU_shader_get_builtin_shader_code(eGPUBuiltinShader shader,
- const char **r_vert,
- const char **r_frag,
- const char **r_geom,
- const char **r_defines)
-{
- const GPUShaderStages *stages = &builtin_shader_stages[shader];
- *r_vert = stages->vert;
- *r_frag = stages->frag;
- *r_geom = stages->geom;
- *r_defines = stages->defs;
-}
-
void GPU_shader_free_builtin_shaders(void)
{
for (int i = 0; i < GPU_SHADER_CFG_LEN; i++) {