Skip to content

Commit

Permalink
Move ShaderWarning definitions into rendering_server
Browse files Browse the repository at this point in the history
  • Loading branch information
smosages committed Feb 25, 2023
1 parent 9ad8dfa commit 786ad51
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
5 changes: 0 additions & 5 deletions editor/plugins/text_shader_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1051,11 +1051,6 @@ void TextShaderEditor::_make_context_menu(bool p_selection, Vector2 p_position)
}

TextShaderEditor::TextShaderEditor() {
GLOBAL_DEF("debug/shader_language/warnings/enable", true);
GLOBAL_DEF("debug/shader_language/warnings/treat_warnings_as_errors", false);
for (int i = 0; i < (int)ShaderWarning::WARNING_MAX; i++) {
GLOBAL_DEF("debug/shader_language/warnings/" + ShaderWarning::get_name_from_code((ShaderWarning::Code)i).to_lower(), true);
}
_update_warnings(false);

shader_editor = memnew(ShaderTextEditor);
Expand Down
10 changes: 10 additions & 0 deletions servers/rendering_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include "core/variant/typed_array.h"
#include "servers/rendering/rendering_server_globals.h"
#include "servers/rendering/shader_language.h"
#include "servers/rendering/shader_warnings.h"

RenderingServer *RenderingServer::singleton = nullptr;
RenderingServer *(*RenderingServer::create_func)() = nullptr;
Expand Down Expand Up @@ -2978,6 +2979,15 @@ void RenderingServer::init() {
GLOBAL_DEF_RST(PropertyInfo(Variant::INT, "rendering/limits/opengl/max_lights_per_object", PROPERTY_HINT_RANGE, "2,1024,1"), 8);

GLOBAL_DEF_RST_BASIC("xr/shaders/enabled", false);

GLOBAL_DEF("debug/shader_language/warnings/enable", true);
GLOBAL_DEF("debug/shader_language/warnings/treat_warnings_as_errors", false);

#ifdef DEBUG_ENABLED
for (int i = 0; i < (int)ShaderWarning::WARNING_MAX; i++) {
GLOBAL_DEF("debug/shader_language/warnings/" + ShaderWarning::get_name_from_code((ShaderWarning::Code)i).to_lower(), true);
}
#endif
}

RenderingServer::~RenderingServer() {
Expand Down

0 comments on commit 786ad51

Please sign in to comment.