diff --git a/drivers/gles3/effects/copy_effects.h b/drivers/gles3/effects/copy_effects.h index 38f79b96a6e..105fbcfe98b 100644 --- a/drivers/gles3/effects/copy_effects.h +++ b/drivers/gles3/effects/copy_effects.h @@ -33,7 +33,7 @@ #ifdef GLES3_ENABLED -#include "../shaders/copy.glsl.gen.h" +#include "drivers/gles3/shaders/copy.glsl.gen.h" namespace GLES3 { diff --git a/drivers/gles3/rasterizer_canvas_gles3.h b/drivers/gles3/rasterizer_canvas_gles3.h index 1c14d0b4660..2eac5f57e1a 100644 --- a/drivers/gles3/rasterizer_canvas_gles3.h +++ b/drivers/gles3/rasterizer_canvas_gles3.h @@ -39,8 +39,8 @@ #include "storage/material_storage.h" #include "storage/texture_storage.h" -#include "shaders/canvas.glsl.gen.h" -#include "shaders/canvas_occlusion.glsl.gen.h" +#include "drivers/gles3/shaders/canvas.glsl.gen.h" +#include "drivers/gles3/shaders/canvas_occlusion.glsl.gen.h" class RasterizerSceneGLES3; diff --git a/drivers/gles3/rasterizer_scene_gles3.h b/drivers/gles3/rasterizer_scene_gles3.h index ff043d67f6e..b4e787ad857 100644 --- a/drivers/gles3/rasterizer_scene_gles3.h +++ b/drivers/gles3/rasterizer_scene_gles3.h @@ -37,13 +37,13 @@ #include "core/templates/paged_allocator.h" #include "core/templates/rid_owner.h" #include "core/templates/self_list.h" +#include "drivers/gles3/shaders/cubemap_filter.glsl.gen.h" +#include "drivers/gles3/shaders/sky.glsl.gen.h" #include "scene/resources/mesh.h" #include "servers/rendering/renderer_compositor.h" #include "servers/rendering/renderer_scene_render.h" #include "servers/rendering_server.h" #include "shader_gles3.h" -#include "shaders/cubemap_filter.glsl.gen.h" -#include "shaders/sky.glsl.gen.h" #include "storage/light_storage.h" #include "storage/material_storage.h" #include "storage/render_scene_buffers_gles3.h" diff --git a/drivers/gles3/storage/material_storage.h b/drivers/gles3/storage/material_storage.h index 4c5861b017e..92399127bba 100644 --- a/drivers/gles3/storage/material_storage.h +++ b/drivers/gles3/storage/material_storage.h @@ -42,11 +42,11 @@ #include "servers/rendering/storage/material_storage.h" #include "servers/rendering/storage/utilities.h" -#include "../shaders/canvas.glsl.gen.h" -#include "../shaders/cubemap_filter.glsl.gen.h" -#include "../shaders/particles.glsl.gen.h" -#include "../shaders/scene.glsl.gen.h" -#include "../shaders/sky.glsl.gen.h" +#include "drivers/gles3/shaders/canvas.glsl.gen.h" +#include "drivers/gles3/shaders/cubemap_filter.glsl.gen.h" +#include "drivers/gles3/shaders/particles.glsl.gen.h" +#include "drivers/gles3/shaders/scene.glsl.gen.h" +#include "drivers/gles3/shaders/sky.glsl.gen.h" namespace GLES3 { diff --git a/drivers/gles3/storage/mesh_storage.h b/drivers/gles3/storage/mesh_storage.h index e1c2bc3f63f..f9122771f9d 100644 --- a/drivers/gles3/storage/mesh_storage.h +++ b/drivers/gles3/storage/mesh_storage.h @@ -33,10 +33,10 @@ #ifdef GLES3_ENABLED -#include "../shaders/skeleton.glsl.gen.h" #include "core/templates/local_vector.h" #include "core/templates/rid_owner.h" #include "core/templates/self_list.h" +#include "drivers/gles3/shaders/skeleton.glsl.gen.h" #include "servers/rendering/storage/mesh_storage.h" #include "servers/rendering/storage/utilities.h" diff --git a/drivers/gles3/storage/particles_storage.h b/drivers/gles3/storage/particles_storage.h index b220c48de98..0e84c2ca8ff 100644 --- a/drivers/gles3/storage/particles_storage.h +++ b/drivers/gles3/storage/particles_storage.h @@ -33,10 +33,10 @@ #ifdef GLES3_ENABLED -#include "../shaders/particles_copy.glsl.gen.h" #include "core/templates/local_vector.h" #include "core/templates/rid_owner.h" #include "core/templates/self_list.h" +#include "drivers/gles3/shaders/particles_copy.glsl.gen.h" #include "servers/rendering/storage/particles_storage.h" #include "servers/rendering/storage/utilities.h" diff --git a/drivers/gles3/storage/texture_storage.h b/drivers/gles3/storage/texture_storage.h index c7029046483..be1e9bd21c4 100644 --- a/drivers/gles3/storage/texture_storage.h +++ b/drivers/gles3/storage/texture_storage.h @@ -39,7 +39,7 @@ #include "servers/rendering/renderer_compositor.h" #include "servers/rendering/storage/texture_storage.h" -#include "../shaders/canvas_sdf.glsl.gen.h" +#include "drivers/gles3/shaders/canvas_sdf.glsl.gen.h" // This must come first to avoid windows.h mess #include "platform_config.h" diff --git a/gles3_builders.py b/gles3_builders.py index 0d0037dea15..6b5a53221c8 100644 --- a/gles3_builders.py +++ b/gles3_builders.py @@ -199,11 +199,21 @@ def include_file_in_gles3_header(filename: str, header_data: GLES3HeaderStruct, return header_data -def build_gles3_header(filename: str, include: str, class_suffix: str, header_data: Optional[GLES3HeaderStruct] = None): +def build_gles3_header( + filename: str, + include: str, + class_suffix: str, + optional_output_filename: str = None, + header_data: Optional[GLES3HeaderStruct] = None, +): header_data = header_data or GLES3HeaderStruct() include_file_in_gles3_header(filename, header_data, 0) - out_file = filename + ".gen.h" + if optional_output_filename is None: + out_file = filename + ".gen.h" + else: + out_file = optional_output_filename + fd = open(out_file, "w") defspec = 0 defvariant = "" diff --git a/glsl_builders.py b/glsl_builders.py index 888f541cf4e..1dcae2fd757 100644 --- a/glsl_builders.py +++ b/glsl_builders.py @@ -114,11 +114,17 @@ def include_file_in_rd_header(filename: str, header_data: RDHeaderStruct, depth: return header_data -def build_rd_header(filename: str, header_data: Optional[RDHeaderStruct] = None) -> None: +def build_rd_header( + filename: str, optional_output_filename: str = None, header_data: Optional[RDHeaderStruct] = None +) -> None: header_data = header_data or RDHeaderStruct() include_file_in_rd_header(filename, header_data, 0) - out_file = filename + ".gen.h" + if optional_output_filename is None: + out_file = filename + ".gen.h" + else: + out_file = optional_output_filename + out_file_base = out_file out_file_base = out_file_base[out_file_base.rfind("/") + 1 :] out_file_base = out_file_base[out_file_base.rfind("\\") + 1 :] @@ -165,7 +171,7 @@ public: def build_rd_headers(target, source, env): for x in source: - build_rd_header(str(x)) + build_rd_header(filename=str(x)) class RAWHeaderStruct: @@ -193,11 +199,17 @@ def include_file_in_raw_header(filename: str, header_data: RAWHeaderStruct, dept fs.close() -def build_raw_header(filename: str, header_data: Optional[RAWHeaderStruct] = None): +def build_raw_header( + filename: str, optional_output_filename: str = None, header_data: Optional[RAWHeaderStruct] = None +): header_data = header_data or RAWHeaderStruct() include_file_in_raw_header(filename, header_data, 0) - out_file = filename + ".gen.h" + if optional_output_filename is None: + out_file = filename + ".gen.h" + else: + out_file = optional_output_filename + out_file_base = out_file.replace(".glsl.gen.h", "_shader_glsl") out_file_base = out_file_base[out_file_base.rfind("/") + 1 :] out_file_base = out_file_base[out_file_base.rfind("\\") + 1 :] @@ -219,7 +231,7 @@ static const char {out_file_base}[] = {{ def build_raw_headers(target, source, env): for x in source: - build_raw_header(str(x)) + build_raw_header(filename=str(x)) if __name__ == "__main__": diff --git a/servers/rendering/renderer_rd/effects/fsr.h b/servers/rendering/renderer_rd/effects/fsr.h index 9cb4894f8db..3ff59bf5849 100644 --- a/servers/rendering/renderer_rd/effects/fsr.h +++ b/servers/rendering/renderer_rd/effects/fsr.h @@ -32,8 +32,8 @@ #define FSR_RD_H #include "../pipeline_cache_rd.h" -#include "../shaders/effects/fsr_upscale.glsl.gen.h" #include "../storage_rd/render_scene_buffers_rd.h" +#include "servers/rendering/renderer_rd/shaders/effects/fsr_upscale.glsl.gen.h" #include "servers/rendering/renderer_scene_render.h" #include "servers/rendering_server.h"