Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/intern/gpu_material_library.c
| Show First 20 Lines • Show All 749 Lines • ▼ Show 20 Lines | while ((code = strstr(code, "void "))) { | ||||
| function = MEM_callocN(sizeof(GPUFunction), "GPUFunction"); | function = MEM_callocN(sizeof(GPUFunction), "GPUFunction"); | ||||
| function->library = library; | function->library = library; | ||||
| code = gpu_str_skip_token(code, NULL, 0); | code = gpu_str_skip_token(code, NULL, 0); | ||||
| code = gpu_str_skip_token(code, function->name, MAX_FUNCTION_NAME); | code = gpu_str_skip_token(code, function->name, MAX_FUNCTION_NAME); | ||||
| /* get parameters */ | /* get parameters */ | ||||
| while (*code && *code != ')') { | while (*code && *code != ')') { | ||||
| if (BLI_str_startswith(code, "const ")) { | |||||
| code = gpu_str_skip_token(code, NULL, 0); | |||||
| } | |||||
| /* test if it's an input or output */ | /* test if it's an input or output */ | ||||
| qual = FUNCTION_QUAL_IN; | qual = FUNCTION_QUAL_IN; | ||||
| if (BLI_str_startswith(code, "out ")) { | if (BLI_str_startswith(code, "out ")) { | ||||
| qual = FUNCTION_QUAL_OUT; | qual = FUNCTION_QUAL_OUT; | ||||
| } | } | ||||
| if (BLI_str_startswith(code, "inout ")) { | if (BLI_str_startswith(code, "inout ")) { | ||||
| qual = FUNCTION_QUAL_INOUT; | qual = FUNCTION_QUAL_INOUT; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 129 Lines • Show Last 20 Lines | |||||