Use a shorter/simpler license convention, stops the header taking so much space. Follow the SPDX license specification: https://spdx.org/licenses - C/C++/objc/objc++ - Python - Shell Scripts - CMake, GNUmakefile While most of the source tree has been included - `./extern/` was left out. - `./intern/cycles` & `./intern/atomic` are also excluded because they use different header conventions. doc/license/SPDX-license-identifiers.txt has been added to list SPDX all used identifiers. See P2788 for the script that automated these edits. Reviewed By: brecht, mont29, sergey Ref D14069
51 lines
1.2 KiB
C++
51 lines
1.2 KiB
C++
/* SPDX-License-Identifier: GPL-2.0-or-later
|
|
* Copyright 2005 Blender Foundation. All rights reserved. */
|
|
|
|
/** \file
|
|
* \ingroup gpu
|
|
*
|
|
* Parsing of and code generation using GLSL shaders in gpu/shaders/material. */
|
|
|
|
#pragma once
|
|
|
|
#include "GPU_material.h"
|
|
|
|
#define MAX_FUNCTION_NAME 64
|
|
#define MAX_PARAMETER 36
|
|
|
|
struct GSet;
|
|
|
|
typedef struct GPUMaterialLibrary {
|
|
char *code;
|
|
struct GPUMaterialLibrary *dependencies[8];
|
|
} GPUMaterialLibrary;
|
|
|
|
typedef enum {
|
|
FUNCTION_QUAL_IN,
|
|
FUNCTION_QUAL_OUT,
|
|
FUNCTION_QUAL_INOUT,
|
|
} GPUFunctionQual;
|
|
|
|
typedef struct GPUFunction {
|
|
char name[MAX_FUNCTION_NAME];
|
|
eGPUType paramtype[MAX_PARAMETER];
|
|
GPUFunctionQual paramqual[MAX_PARAMETER];
|
|
int totparam;
|
|
GPUMaterialLibrary *library;
|
|
} GPUFunction;
|
|
|
|
/* Module */
|
|
|
|
void gpu_material_library_init(void);
|
|
void gpu_material_library_exit(void);
|
|
|
|
/* Code Generation */
|
|
|
|
GPUFunction *gpu_material_library_use_function(struct GSet *used_libraries, const char *name);
|
|
char *gpu_material_library_generate_code(struct GSet *used_libraries, const char *frag_lib);
|
|
|
|
/* Code Parsing */
|
|
|
|
const char *gpu_str_skip_token(const char *str, char *token, int max);
|
|
const char *gpu_data_type_to_string(eGPUType type);
|