Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/intern/gpu_codegen.cc
| Show First 20 Lines • Show All 345 Lines • ▼ Show 20 Lines | void GPUCodegen::generate_attribs() | ||||
| output.attr_load = extract_c_str(load_ss); | output.attr_load = extract_c_str(load_ss); | ||||
| } | } | ||||
| void GPUCodegen::generate_resources() | void GPUCodegen::generate_resources() | ||||
| { | { | ||||
| GPUCodegenCreateInfo &info = *create_info; | GPUCodegenCreateInfo &info = *create_info; | ||||
| /* Ref. T98190: Defines are optimizations for old compilers. | |||||
| * Might become unecessary with EEVEE-Next. */ | |||||
| if (GPU_material_flag_get(&mat, GPU_MATFLAG_PRINCIPLED_CLEARCOAT)) { | |||||
| info.define("PRINCIPLED_CLEARCOAT"); | |||||
| } | |||||
| if (GPU_material_flag_get(&mat, GPU_MATFLAG_PRINCIPLED_METALLIC)) { | |||||
| info.define("PRINCIPLED_METALLIC"); | |||||
| } | |||||
| if (GPU_material_flag_get(&mat, GPU_MATFLAG_PRINCIPLED_DIELECTRIC)) { | |||||
| info.define("PRINCIPLED_DIELECTRIC"); | |||||
| } | |||||
| if (GPU_material_flag_get(&mat, GPU_MATFLAG_PRINCIPLED_GLASS)) { | |||||
| info.define("PRINCIPLED_GLASS"); | |||||
| } | |||||
| if (GPU_material_flag_get(&mat, GPU_MATFLAG_PRINCIPLED_ANY)) { | |||||
| info.define("PRINCIPLED_ANY"); | |||||
| } | |||||
| std::stringstream ss; | std::stringstream ss; | ||||
| /* Textures. */ | /* Textures. */ | ||||
| LISTBASE_FOREACH (GPUMaterialTexture *, tex, &graph.textures) { | LISTBASE_FOREACH (GPUMaterialTexture *, tex, &graph.textures) { | ||||
| if (tex->colorband) { | if (tex->colorband) { | ||||
| const char *name = info.name_buffer.append_sampler_name(tex->sampler_name); | const char *name = info.name_buffer.append_sampler_name(tex->sampler_name); | ||||
| info.sampler(0, ImageType::FLOAT_1D_ARRAY, name, Frequency::BATCH); | info.sampler(0, ImageType::FLOAT_1D_ARRAY, name, Frequency::BATCH); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 440 Lines • Show Last 20 Lines | |||||