1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Cleanup some things in shader editor code

This commit is contained in:
Aaron Franke
2025-08-26 16:25:31 -07:00
parent ab6c6eece8
commit e26e96df4b
5 changed files with 56 additions and 33 deletions

View File

@@ -30,6 +30,8 @@
#include "shader_types.h"
#include "scene/resources/shader.h"
const HashMap<StringName, ShaderLanguage::FunctionInfo> &ShaderTypes::get_functions(RS::ShaderMode p_mode) const {
return shader_modes[p_mode].functions;
}
@@ -516,11 +518,13 @@ ShaderTypes::ShaderTypes() {
shader_modes[RS::SHADER_FOG].functions["fog"].built_ins["EMISSION"] = ShaderLanguage::TYPE_VEC3;
shader_modes[RS::SHADER_FOG].functions["fog"].main_function = true;
// Must be kept in sync with the Shader::Mode enum.
shader_types_list.push_back("spatial");
shader_types_list.push_back("canvas_item");
shader_types_list.push_back("particles");
shader_types_list.push_back("sky");
shader_types_list.push_back("fog");
DEV_ASSERT(shader_types_list.size() == Shader::MODE_MAX);
for (const String &type : shader_types_list) {
shader_types.insert(type);