From 358820c4b7130014910ad07ebf1694d4e0b5ca16 Mon Sep 17 00:00:00 2001 From: clayjohn Date: Tue, 16 Nov 2021 07:49:56 -0800 Subject: Fix SRGB conversions in Vulkan Renderer --- .../renderer_rd/forward_clustered/scene_shader_forward_clustered.cpp | 1 + .../renderer_rd/forward_mobile/scene_shader_forward_mobile.cpp | 1 + servers/rendering/renderer_rd/renderer_storage_rd.cpp | 2 +- servers/rendering/renderer_rd/shaders/scene_forward_clustered.glsl | 4 ++++ servers/rendering/renderer_rd/shaders/scene_forward_mobile.glsl | 4 ++++ 5 files changed, 11 insertions(+), 1 deletion(-) diff --git a/servers/rendering/renderer_rd/forward_clustered/scene_shader_forward_clustered.cpp b/servers/rendering/renderer_rd/forward_clustered/scene_shader_forward_clustered.cpp index b74d7f9c31..b0e6a1a4bf 100644 --- a/servers/rendering/renderer_rd/forward_clustered/scene_shader_forward_clustered.cpp +++ b/servers/rendering/renderer_rd/forward_clustered/scene_shader_forward_clustered.cpp @@ -576,6 +576,7 @@ void SceneShaderForwardClustered::init(RendererStorageRD *p_storage, const Strin actions.renames["CUSTOM1"] = "custom1_attrib"; actions.renames["CUSTOM2"] = "custom2_attrib"; actions.renames["CUSTOM3"] = "custom3_attrib"; + actions.renames["OUTPUT_IS_SRGB"] = "SHADER_IS_SRGB"; // not implemented but need these just in case code is in the shaders actions.renames["VIEW_INDEX"] = "0"; diff --git a/servers/rendering/renderer_rd/forward_mobile/scene_shader_forward_mobile.cpp b/servers/rendering/renderer_rd/forward_mobile/scene_shader_forward_mobile.cpp index 16d650a540..016f2dbc14 100644 --- a/servers/rendering/renderer_rd/forward_mobile/scene_shader_forward_mobile.cpp +++ b/servers/rendering/renderer_rd/forward_mobile/scene_shader_forward_mobile.cpp @@ -564,6 +564,7 @@ void SceneShaderForwardMobile::init(RendererStorageRD *p_storage, const String p actions.renames["CUSTOM1"] = "custom1_attrib"; actions.renames["CUSTOM2"] = "custom2_attrib"; actions.renames["CUSTOM3"] = "custom3_attrib"; + actions.renames["OUTPUT_IS_SRGB"] = "SHADER_IS_SRGB"; actions.renames["VIEW_INDEX"] = "ViewIndex"; actions.renames["VIEW_MONO_LEFT"] = "0"; diff --git a/servers/rendering/renderer_rd/renderer_storage_rd.cpp b/servers/rendering/renderer_rd/renderer_storage_rd.cpp index 5c7fee7ec9..01552dc6d7 100644 --- a/servers/rendering/renderer_rd/renderer_storage_rd.cpp +++ b/servers/rendering/renderer_rd/renderer_storage_rd.cpp @@ -2857,7 +2857,7 @@ bool RendererStorageRD::MaterialData::update_parameters_uniform_set(const Mapbuffer_update(uniform_buffer, 0, ubo_data.size(), ubo_data.ptrw(), p_barrier); } diff --git a/servers/rendering/renderer_rd/shaders/scene_forward_clustered.glsl b/servers/rendering/renderer_rd/shaders/scene_forward_clustered.glsl index 4119e98d15..772472b3f2 100644 --- a/servers/rendering/renderer_rd/shaders/scene_forward_clustered.glsl +++ b/servers/rendering/renderer_rd/shaders/scene_forward_clustered.glsl @@ -6,6 +6,8 @@ #include "scene_forward_clustered_inc.glsl" +#define SHADER_IS_SRGB false + /* INPUT ATTRIBS */ layout(location = 0) in vec3 vertex_attrib; @@ -358,6 +360,8 @@ void main() { #VERSION_DEFINES +#define SHADER_IS_SRGB false + /* Specialization Constants (Toggles) */ layout(constant_id = 0) const bool sc_use_forward_gi = false; diff --git a/servers/rendering/renderer_rd/shaders/scene_forward_mobile.glsl b/servers/rendering/renderer_rd/shaders/scene_forward_mobile.glsl index 2f5cc58619..d69cf6e861 100644 --- a/servers/rendering/renderer_rd/shaders/scene_forward_mobile.glsl +++ b/servers/rendering/renderer_rd/shaders/scene_forward_mobile.glsl @@ -7,6 +7,8 @@ /* Include our forward mobile UBOs definitions etc. */ #include "scene_forward_mobile_inc.glsl" +#define SHADER_IS_SRGB false + /* INPUT ATTRIBS */ layout(location = 0) in vec3 vertex_attrib; @@ -370,6 +372,8 @@ void main() { #VERSION_DEFINES +#define SHADER_IS_SRGB false + /* Specialization Constants */ #if !defined(MODE_RENDER_DEPTH) -- cgit v1.2.3