Blender  V2.93
gpu_material_library.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2005 Blender Foundation.
17  * All rights reserved.
18  */
19 
25 #pragma once
26 
27 #include "GPU_material.h"
28 
29 #define MAX_FUNCTION_NAME 64
30 #define MAX_PARAMETER 32
31 
32 struct GSet;
33 
34 typedef struct GPUMaterialLibrary {
35  char *code;
38 
39 typedef enum {
44 
45 typedef struct GPUFunction {
49  int totparam;
52 
53 /* Module */
54 
55 void gpu_material_library_init(void);
56 void gpu_material_library_exit(void);
57 
58 /* Code Generation */
59 
60 GPUFunction *gpu_material_library_use_function(struct GSet *used_libraries, const char *name);
61 char *gpu_material_library_generate_code(struct GSet *used_libraries, const char *frag_lib);
62 
63 /* Code Parsing */
64 
65 char *gpu_str_skip_token(char *str, char *token, int max);
66 const char *gpu_data_type_to_string(const eGPUType type);
struct GSet GSet
Definition: BLI_ghash.h:189
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
eGPUType
Definition: GPU_material.h:59
#define str(s)
struct GPUMaterialLibrary GPUMaterialLibrary
void gpu_material_library_exit(void)
struct GPUFunction GPUFunction
GPUFunction * gpu_material_library_use_function(struct GSet *used_libraries, const char *name)
void gpu_material_library_init(void)
GPUFunctionQual
@ FUNCTION_QUAL_IN
@ FUNCTION_QUAL_OUT
@ FUNCTION_QUAL_INOUT
char * gpu_material_library_generate_code(struct GSet *used_libraries, const char *frag_lib)
const char * gpu_data_type_to_string(const eGPUType type)
#define MAX_FUNCTION_NAME
char * gpu_str_skip_token(char *str, char *token, int max)
#define MAX_PARAMETER
eGPUType paramtype[MAX_PARAMETER]
char name[MAX_FUNCTION_NAME]
GPUMaterialLibrary * library
GPUFunctionQual paramqual[MAX_PARAMETER]
struct GPUMaterialLibrary * dependencies[8]
float max