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:
authorJeroen Bakker <jeroen@blender.org>2022-01-25 16:22:44 +0300
committerJeroen Bakker <jeroen@blender.org>2022-01-25 16:22:44 +0300
commitc5980ada4fd564add37e878e372d1249715636b1 (patch)
tree3019802f5db33332f98d3430beaa3079f52da42c /source/blender/gpu/intern/gpu_shader.cc
parent17b0c06946bef39e29e3b0b1a5faaf8faca35daa (diff)
GPU: Add GPU_shader_create_from_info_name
This function will be used as the way to build shaders from create_infos. The previous used method was using a private function.
Diffstat (limited to 'source/blender/gpu/intern/gpu_shader.cc')
-rw-r--r--source/blender/gpu/intern/gpu_shader.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/gpu/intern/gpu_shader.cc b/source/blender/gpu/intern/gpu_shader.cc
index 3b41e804fd4..8c97f423800 100644
--- a/source/blender/gpu/intern/gpu_shader.cc
+++ b/source/blender/gpu/intern/gpu_shader.cc
@@ -249,6 +249,18 @@ GPUShader *GPU_shader_create_compute(const char *computecode,
shname);
}
+GPUShader *GPU_shader_create_from_info_name(const char *info_name)
+{
+ using namespace blender::gpu::shader;
+ const GPUShaderCreateInfo *_info = gpu_shader_create_info_get(info_name);
+ const ShaderCreateInfo &info = *reinterpret_cast<const ShaderCreateInfo *>(_info);
+ if (!info.do_static_compilation_) {
+ printf("Warning: Trying to compile \"%s\" which was not marked for static compilation.\n",
+ info.name_.c_str());
+ }
+ return GPU_shader_create_from_info(_info);
+}
+
GPUShader *GPU_shader_create_from_info(const GPUShaderCreateInfo *_info)
{
using namespace blender::gpu::shader;