Fix SRGB conversions in Vulkan Renderer

This commit is contained in:
clayjohn 2021-11-16 07:49:56 -08:00
parent 11e03ae7f0
commit 358820c4b7
5 changed files with 11 additions and 1 deletions

View File

@ -576,6 +576,7 @@ void SceneShaderForwardClustered::init(RendererStorageRD *p_storage, const Strin
actions.renames["CUSTOM1"] = "custom1_attrib"; actions.renames["CUSTOM1"] = "custom1_attrib";
actions.renames["CUSTOM2"] = "custom2_attrib"; actions.renames["CUSTOM2"] = "custom2_attrib";
actions.renames["CUSTOM3"] = "custom3_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 // not implemented but need these just in case code is in the shaders
actions.renames["VIEW_INDEX"] = "0"; actions.renames["VIEW_INDEX"] = "0";

View File

@ -564,6 +564,7 @@ void SceneShaderForwardMobile::init(RendererStorageRD *p_storage, const String p
actions.renames["CUSTOM1"] = "custom1_attrib"; actions.renames["CUSTOM1"] = "custom1_attrib";
actions.renames["CUSTOM2"] = "custom2_attrib"; actions.renames["CUSTOM2"] = "custom2_attrib";
actions.renames["CUSTOM3"] = "custom3_attrib"; actions.renames["CUSTOM3"] = "custom3_attrib";
actions.renames["OUTPUT_IS_SRGB"] = "SHADER_IS_SRGB";
actions.renames["VIEW_INDEX"] = "ViewIndex"; actions.renames["VIEW_INDEX"] = "ViewIndex";
actions.renames["VIEW_MONO_LEFT"] = "0"; actions.renames["VIEW_MONO_LEFT"] = "0";

View File

@ -2857,7 +2857,7 @@ bool RendererStorageRD::MaterialData::update_parameters_uniform_set(const Map<St
//check whether buffer changed //check whether buffer changed
if (p_uniform_dirty && ubo_data.size()) { if (p_uniform_dirty && ubo_data.size()) {
update_uniform_buffer(p_uniforms, p_uniform_offsets, p_parameters, ubo_data.ptrw(), ubo_data.size(), false); update_uniform_buffer(p_uniforms, p_uniform_offsets, p_parameters, ubo_data.ptrw(), ubo_data.size(), true);
RD::get_singleton()->buffer_update(uniform_buffer, 0, ubo_data.size(), ubo_data.ptrw(), p_barrier); RD::get_singleton()->buffer_update(uniform_buffer, 0, ubo_data.size(), ubo_data.ptrw(), p_barrier);
} }

View File

@ -6,6 +6,8 @@
#include "scene_forward_clustered_inc.glsl" #include "scene_forward_clustered_inc.glsl"
#define SHADER_IS_SRGB false
/* INPUT ATTRIBS */ /* INPUT ATTRIBS */
layout(location = 0) in vec3 vertex_attrib; layout(location = 0) in vec3 vertex_attrib;
@ -358,6 +360,8 @@ void main() {
#VERSION_DEFINES #VERSION_DEFINES
#define SHADER_IS_SRGB false
/* Specialization Constants (Toggles) */ /* Specialization Constants (Toggles) */
layout(constant_id = 0) const bool sc_use_forward_gi = false; layout(constant_id = 0) const bool sc_use_forward_gi = false;

View File

@ -7,6 +7,8 @@
/* Include our forward mobile UBOs definitions etc. */ /* Include our forward mobile UBOs definitions etc. */
#include "scene_forward_mobile_inc.glsl" #include "scene_forward_mobile_inc.glsl"
#define SHADER_IS_SRGB false
/* INPUT ATTRIBS */ /* INPUT ATTRIBS */
layout(location = 0) in vec3 vertex_attrib; layout(location = 0) in vec3 vertex_attrib;
@ -370,6 +372,8 @@ void main() {
#VERSION_DEFINES #VERSION_DEFINES
#define SHADER_IS_SRGB false
/* Specialization Constants */ /* Specialization Constants */
#if !defined(MODE_RENDER_DEPTH) #if !defined(MODE_RENDER_DEPTH)