Merge pull request #71119 from RandomShaper/shader_rehash
Make inclusion of Godot version in shader hash universal
This commit is contained in:
commit
f5f7d11ac4
2 changed files with 6 additions and 2 deletions
|
@ -36,7 +36,6 @@
|
||||||
#include "core/io/marshalls.h"
|
#include "core/io/marshalls.h"
|
||||||
#include "core/os/os.h"
|
#include "core/os/os.h"
|
||||||
#include "core/templates/hashfuncs.h"
|
#include "core/templates/hashfuncs.h"
|
||||||
#include "core/version.h"
|
|
||||||
#include "drivers/vulkan/vulkan_context.h"
|
#include "drivers/vulkan/vulkan_context.h"
|
||||||
|
|
||||||
#include "thirdparty/misc/smolv.h"
|
#include "thirdparty/misc/smolv.h"
|
||||||
|
@ -4574,7 +4573,7 @@ String RenderingDeviceVulkan::_shader_uniform_debug(RID p_shader, int p_set) {
|
||||||
#define SHADER_BINARY_VERSION 3
|
#define SHADER_BINARY_VERSION 3
|
||||||
|
|
||||||
String RenderingDeviceVulkan::shader_get_binary_cache_key() const {
|
String RenderingDeviceVulkan::shader_get_binary_cache_key() const {
|
||||||
return "Vulkan-SV" + itos(SHADER_BINARY_VERSION) + "-" + String(VERSION_NUMBER) + "-" + String(VERSION_HASH);
|
return "Vulkan-SV" + itos(SHADER_BINARY_VERSION);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct RenderingDeviceVulkanShaderBinaryDataBinding {
|
struct RenderingDeviceVulkanShaderBinaryDataBinding {
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
#include "core/io/compression.h"
|
#include "core/io/compression.h"
|
||||||
#include "core/io/dir_access.h"
|
#include "core/io/dir_access.h"
|
||||||
#include "core/io/file_access.h"
|
#include "core/io/file_access.h"
|
||||||
|
#include "core/version.h"
|
||||||
#include "renderer_compositor_rd.h"
|
#include "renderer_compositor_rd.h"
|
||||||
#include "servers/rendering/rendering_device.h"
|
#include "servers/rendering/rendering_device.h"
|
||||||
#include "thirdparty/misc/smolv.h"
|
#include "thirdparty/misc/smolv.h"
|
||||||
|
@ -116,6 +117,10 @@ void ShaderRD::setup(const char *p_vertex_code, const char *p_fragment_code, con
|
||||||
}
|
}
|
||||||
|
|
||||||
StringBuilder tohash;
|
StringBuilder tohash;
|
||||||
|
tohash.append("[GodotVersionNumber]");
|
||||||
|
tohash.append(VERSION_NUMBER);
|
||||||
|
tohash.append("[GodotVersionHash]");
|
||||||
|
tohash.append(VERSION_HASH);
|
||||||
tohash.append("[SpirvCacheKey]");
|
tohash.append("[SpirvCacheKey]");
|
||||||
tohash.append(RenderingDevice::get_singleton()->shader_get_spirv_cache_key());
|
tohash.append(RenderingDevice::get_singleton()->shader_get_spirv_cache_key());
|
||||||
tohash.append("[BinaryCacheKey]");
|
tohash.append("[BinaryCacheKey]");
|
||||||
|
|
Loading…
Reference in a new issue