mirror of
https://github.com/godotengine/godot.git
synced 2025-10-20 00:13:30 +00:00
New lightmapper
-Added LocalVector (needed it) -Added stb_rect_pack (It's pretty cool, we could probably use it for other stuff too) -Fixes and changes all around the place -Added library for 128 bits fixed point (required for Delaunay3D)
This commit is contained in:
parent
6a0473bcc2
commit
1bea8e1eac
434 changed files with 126122 additions and 3384 deletions
|
@ -30,7 +30,7 @@
|
|||
|
||||
#include "rendering_device_binds.h"
|
||||
|
||||
Error RDShaderFile::parse_versions_from_text(const String &p_text, OpenIncludeFunction p_include_func, void *p_include_func_userdata) {
|
||||
Error RDShaderFile::parse_versions_from_text(const String &p_text, const String p_defines, OpenIncludeFunction p_include_func, void *p_include_func_userdata) {
|
||||
|
||||
Vector<String> lines = p_text.split("\n");
|
||||
|
||||
|
@ -56,6 +56,9 @@ Error RDShaderFile::parse_versions_from_text(const String &p_text, OpenIncludeFu
|
|||
|
||||
{
|
||||
String ls = line.strip_edges();
|
||||
if (ls.begins_with("#[")) { //workaround for clang format
|
||||
ls = ls.replace_first("#[", "[");
|
||||
}
|
||||
if (ls.begins_with("[") && ls.ends_with("]")) {
|
||||
String section = ls.substr(1, ls.length() - 2).strip_edges();
|
||||
if (section == "versions") {
|
||||
|
@ -90,9 +93,17 @@ Error RDShaderFile::parse_versions_from_text(const String &p_text, OpenIncludeFu
|
|||
}
|
||||
}
|
||||
|
||||
if (stage == RD::SHADER_STAGE_MAX && line.strip_edges() != "") {
|
||||
line = line.strip_edges();
|
||||
if (line.begins_with("//") || line.begins_with("/*")) {
|
||||
continue; //assuming comment (single line)
|
||||
}
|
||||
}
|
||||
|
||||
if (reading_versions) {
|
||||
String l = line.strip_edges();
|
||||
if (l != "") {
|
||||
|
||||
int eqpos = l.find("=");
|
||||
if (eqpos == -1) {
|
||||
base_error = "Version syntax is version=\"<defines with C escaping>\".";
|
||||
|
@ -110,7 +121,7 @@ Error RDShaderFile::parse_versions_from_text(const String &p_text, OpenIncludeFu
|
|||
}
|
||||
define = "\n" + define.substr(1, define.length() - 2).c_unescape() + "\n"; //add newline before and after jsut in case
|
||||
|
||||
version_texts[version] = define;
|
||||
version_texts[version] = define + "\n" + p_defines;
|
||||
}
|
||||
} else {
|
||||
if (stage == RD::SHADER_STAGE_MAX && line.strip_edges() != "") {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue