Fixed: incorrect CRC check for OpenGL shaders

#rb allan.bentham

#ROBOMERGE-AUTHOR: dmitriy.dyomin
#ROBOMERGE-SOURCE: CL 19418910 via CL 19418927 via CL 19419418 via CL 19428996 via CL 19429147
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v930-19419903)

[CL 19432565 by dmitriy dyomin in ue5-main branch]
This commit is contained in:
dmitriy dyomin
2022-03-18 02:32:51 -04:00
parent 5db6bf7c49
commit 968550df5c
@@ -989,12 +989,14 @@ void OPENGLDRV_API GLSLToDeviceCompatibleGLSL(FAnsiCharArray& GlslCodeOriginal,
}
}
#if DEBUG_GL_SHADERS
if (ShaderName.IsEmpty() == false)
{
AppendCString(GlslCode, "// ");
AppendCString(GlslCode, TCHAR_TO_ANSI(ShaderName.GetCharArray().GetData()));
AppendCString(GlslCode, "\n");
}
#endif
if (bEmitMobileMultiView && GSupportsMobileMultiView && TypeEnum == GL_VERTEX_SHADER)
{
@@ -1130,7 +1132,8 @@ RHIType* CreateProxyShader(TArrayView<const uint8> Code, const FSHAHash& Hash)
GLSLToPlatform(Header, TypeEnum, GlslCodeOriginal, Finalglsl);
GetOpenGLCompiledShaderCache().Add(ShaderCodeKey, MakeShareable(new FOpenGLCompiledShaderValue(0, Finalglsl)));
}
#if (UE_BUILD_DEBUG || UE_BUILD_DEVELOPMENT)
// With debug shaders we insert a shader name into the source and that can make it unique failing CRC check
#if (UE_BUILD_DEBUG || UE_BUILD_DEVELOPMENT) && !DEBUG_GL_SHADERS
else
{
QUICK_SCOPE_CYCLE_COUNTER(STAT_GLCheckShaderCodeCRC);