Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/intern/gpu_codegen.c
| Show First 20 Lines • Show All 266 Lines • ▼ Show 20 Lines | else if (builtin == GPU_PARTICLE_ANG_VELOCITY) { | ||||
| return "unfparticleangvel"; | return "unfparticleangvel"; | ||||
| } | } | ||||
| else if (builtin == GPU_OBJECT_INFO) { | else if (builtin == GPU_OBJECT_INFO) { | ||||
| return "unfobjectinfo"; | return "unfobjectinfo"; | ||||
| } | } | ||||
| else if (builtin == GPU_VOLUME_DENSITY) { | else if (builtin == GPU_VOLUME_DENSITY) { | ||||
| return "sampdensity"; | return "sampdensity"; | ||||
| } | } | ||||
| else if (builtin == GPU_VOLUME_COLOR) { | |||||
| return "sampcolor"; | |||||
| } | |||||
| else if (builtin == GPU_VOLUME_FLAME) { | else if (builtin == GPU_VOLUME_FLAME) { | ||||
| return "sampflame"; | return "sampflame"; | ||||
| } | } | ||||
| else if (builtin == GPU_VOLUME_TEMPERATURE) { | else if (builtin == GPU_VOLUME_TEMPERATURE) { | ||||
| return "unftemperature"; | return "unftemperature"; | ||||
| } | } | ||||
| else if (builtin == GPU_BARYCENTRIC_TEXCO) { | else if (builtin == GPU_BARYCENTRIC_TEXCO) { | ||||
| return "unfbarycentrictex"; | return "unfbarycentrictex"; | ||||
| ▲ Show 20 Lines • Show All 63 Lines • ▼ Show 20 Lines | for (node = graph->nodes.first; node; node = node->next) { | ||||
| for (input = node->inputs.first; input; input = input->next) { | for (input = node->inputs.first; input; input = input->next) { | ||||
| if (input->source == GPU_SOURCE_BUILTIN) { | if (input->source == GPU_SOURCE_BUILTIN) { | ||||
| /* only define each builtin uniform/varying once */ | /* only define each builtin uniform/varying once */ | ||||
| if (!(builtins & input->builtin)) { | if (!(builtins & input->builtin)) { | ||||
| builtins |= input->builtin; | builtins |= input->builtin; | ||||
| name = gpu_builtin_name(input->builtin); | name = gpu_builtin_name(input->builtin); | ||||
| if (BLI_str_startswith(name, "samp")) { | if (BLI_str_startswith(name, "samp")) { | ||||
| if ((input->builtin == GPU_VOLUME_DENSITY) || (input->builtin == GPU_VOLUME_FLAME)) { | if ((input->builtin == GPU_VOLUME_DENSITY) || (input->builtin == GPU_VOLUME_COLOR) || | ||||
| (input->builtin == GPU_VOLUME_FLAME)) { | |||||
| BLI_dynstr_appendf(ds, "uniform sampler3D %s;\n", name); | BLI_dynstr_appendf(ds, "uniform sampler3D %s;\n", name); | ||||
| } | } | ||||
| } | } | ||||
| else if (BLI_str_startswith(name, "unf")) { | else if (BLI_str_startswith(name, "unf")) { | ||||
| BLI_dynstr_appendf(ds, "uniform %s %s;\n", gpu_data_type_to_string(input->type), name); | BLI_dynstr_appendf(ds, "uniform %s %s;\n", gpu_data_type_to_string(input->type), name); | ||||
| } | } | ||||
| else { | else { | ||||
| BLI_dynstr_appendf(ds, "in %s %s;\n", gpu_data_type_to_string(input->type), name); | BLI_dynstr_appendf(ds, "in %s %s;\n", gpu_data_type_to_string(input->type), name); | ||||
| ▲ Show 20 Lines • Show All 966 Lines • Show Last 20 Lines | |||||