Repository: godotengine/godot
File: drivers/gles3/storage/material_storage.cpp (C++)

Code before:
	alpha_antialiasing_mode = AlphaAntiAliasing(alpha_antialiasing_modei);
	vertex_input_mask = uint32_t(uses_normal);
	vertex_input_mask |= uses_tangent << 1;
	vertex_input_mask |= uses_color << 2;
	vertex_input_mask |= uses_uv << 3;
	vertex_input_mask |= uses_uv2 << 4;
	vertex_input_mask |= uses_custom0 << 5;
	vertex_input_mask |= uses_custom1 << 6;
	vertex_input_mask |= uses_custom2 << 7;
	vertex_input_mask |= uses_custom3 << 8;
	vertex_input_mask |= uses_bones << 9;
	vertex_input_mask |= uses_weights << 10;
	uses_screen_texture_mipmaps = gen_code.uses_screen_texture_mipmaps;
	uses_screen_texture = gen_code.uses_screen_texture;
	uses_depth_texture = gen_code.uses_depth_texture;
	uses_normal_texture = gen_code.uses_normal_roughness_texture;
	uses_vertex_time = gen_code.uses_vertex_time;
	uses_fragment_time = gen_code.uses_fragment_time;

#if 0
	print_line("**compiling shader:");
	print_line("**defines:\n");
	for (int i = 0; i < gen_code.defines.size(); i++) {
		print_line(gen_code.defines[i]);
	}

	HashMap<String, String>::Iterator el = gen_code.code.begin();
	while (el) {
		print_line("\n**code " + el->key + ":\n" + el->value);
		++el;
	}

	print_line("\n**uniforms:\n" + gen_code.uniforms);
	print_line("\n**vertex_globals:\n" + gen_code.stage_globals[ShaderCompiler::STAGE_VERTEX]);
	print_line("\n**fragment_globals:\n" + gen_code.stage_globals[ShaderCompiler::STAGE_FRAGMENT]);
#endif

	Vector<StringName> texture_uniform_names;
	for (int i = 0; i < gen_code.texture_uniforms.size(); i++) {
		texture_uniform_names.push_back(gen_code.texture_uniforms[i].name);
	}

	MaterialStorage::get_singleton()->shaders.scene_shader.version_set_code(version, gen_code.code, gen_code.uniforms, gen_code.stage_globals[ShaderCompiler::STAGE_VERTEX], gen_code.stage_globals[ShaderCompiler::STAGE_FRAGMENT], gen_code.defines, texture_uniform_names);
	ERR_FAIL_COND(!MaterialStorage::get_singleton()->shaders.scene_shader.version_is_valid(version));

	ubo_size = gen_code.uniform_total_size;
	ubo_offsets = gen_code.uniform_offsets;
	texture_uniforms = gen_code.texture_uniforms;

	// if any form of Alpha Antialiasing is enabled, set the blend mode to alpha to coverage
	if (alpha_antialiasing_mode != ALPHA_ANTIALIASING_OFF) {

Review comment (suggestion):
```suggestion
		WARN_PRINT_ONCE_ED("Subsurface scattering is only available when using the Forward+ rendering backend.");
```


Code after:
	alpha_antialiasing_mode = AlphaAntiAliasing(alpha_antialiasing_modei);
	vertex_input_mask = uint32_t(uses_normal);
	vertex_input_mask |= uses_tangent << 1;
	vertex_input_mask |= uses_color << 2;
	vertex_input_mask |= uses_uv << 3;
	vertex_input_mask |= uses_uv2 << 4;
	vertex_input_mask |= uses_custom0 << 5;
	vertex_input_mask |= uses_custom1 << 6;
	vertex_input_mask |= uses_custom2 << 7;
	vertex_input_mask |= uses_custom3 << 8;
	vertex_input_mask |= uses_bones << 9;
	vertex_input_mask |= uses_weights << 10;
	uses_screen_texture_mipmaps = gen_code.uses_screen_texture_mipmaps;
	uses_screen_texture = gen_code.uses_screen_texture;
	uses_depth_texture = gen_code.uses_depth_texture;
	uses_normal_texture = gen_code.uses_normal_roughness_texture;
	uses_vertex_time = gen_code.uses_vertex_time;
	uses_fragment_time = gen_code.uses_fragment_time;

#ifdef DEBUG_ENABLED
	if (uses_particle_trails) {
		WARN_PRINT_ONCE_ED("Particle trails are only available when using the Forward+ or Mobile rendering backends.");
	}

	if (uses_sss) {
		WARN_PRINT_ONCE_ED("Sub-surface scattering is only available when using the Forward+ rendering backend.");
	}

	if (uses_transmittance) {
		WARN_PRINT_ONCE_ED("Transmittance is only available when using the Forward+ rendering backend.");
	}

	if (uses_screen_texture) {
		WARN_PRINT_ONCE_ED("Reading from the screen texture is not supported when using the GL Compatibility backend yet. Support will be added in a future release.");
	}

	if (uses_depth_texture) {
		WARN_PRINT_ONCE_ED("Reading from the depth texture is not supported when using the GL Compatibility backend yet. Support will be added in a future release.");
	}

	if (uses_normal_texture) {
		WARN_PRINT_ONCE_ED("Reading from the normal-roughness texture is only available when using the Forward+ or Mobile rendering backends.");
	}
#endif

#if 0
	print_line("**compiling shader:");
	print_line("**defines:\n");
	for (int i = 0; i < gen_code.defines.size(); i++) {
		print_line(gen_code.defines[i]);
	}