![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include "OpenGLShaders.h"#include "HAL/PlatformFileManager.h"#include "HAL/FileManager.h"#include "Misc/Paths.h"#include "Misc/Compression.h"#include "Serialization/MemoryWriter.h"#include "Serialization/MemoryReader.h"#include "OpenGLDrvPrivate.h"#include "Shader.h"#include "GlobalShader.h"#include "SceneUtils.h"#include "PsoLruCache.h"#include "RHICoreShader.h"#include "OpenGLProgramBinaryFileCache.h"#include "OpenGLBinaryProgramUtils.h"#include "HAL/PlatformFramePacer.h"Classes | |
| class | FOpenGLBinaryCacheStats |
| class | FOpenGLCompiledShaderValue |
| struct | FOpenGLUniformName |
| class | FOpenGLLinkedProgramBase |
| class | FOpenGLLinkedProgram |
| struct | FOpenGLLinkedProgram::FPackedUniformInfo |
| struct | FOpenGLLinkedProgram::FShaderStage |
| struct | FOpenGLLinkedProgram::FGraphicsProgram |
| struct | FOpenGLLinkedProgram::FComputeProgram |
| class | FOpenGLLinkedProgram::FLRUInfo |
| class | FGLProgramCacheLRU |
| class | FGLProgramCache |
| struct | FOpenGLShaderVaryingMapping |
Namespaces | |
| namespace | UE |
| namespace | UE::OpenGL |
Macros | |
| #define | VERIFY_GL_SHADER_LINK 1 |
| #define | VERIFY_GL_SHADER_COMPILE 1 |
| #define | OGL_BINARYCACHE_STATS !UE_BUILD_SHIPPING |
| #define | OGL_BINARYCACHE_STATS_MARKBEGINCOMPILE(x) if(FOpenGLBinaryCacheStats::IsEnabled()) { FOpenGLBinaryCacheStats::Get().MarkStartTime(x);} |
| #define | OGL_BINARYCACHE_STATS_MARKCOMPILED(x) if(FOpenGLBinaryCacheStats::IsEnabled()) { FOpenGLBinaryCacheStats::Get().MarkCompileFinishTime(x);} |
| #define | OGL_BINARYCACHE_STATS_MARKBINARYCACHEMISS(x, y) if(FOpenGLBinaryCacheStats::IsEnabled()) { FOpenGLBinaryCacheStats::Get().MarkCacheMissedTime(x,y);} |
| #define | OGL_BINARYCACHE_STATS_MARKBINARYCACHEUSE(x) if(FOpenGLBinaryCacheStats::IsEnabled()) { FOpenGLBinaryCacheStats::Get().MarkCacheUse(x);} |
| #define | OGL_BINARYCACHE_STATS_LOG() if(FOpenGLBinaryCacheStats::IsEnabled()) { FOpenGLBinaryCacheStats::Get().LogStats();} |
| #define | LAST_RELEASED_PROGRAMS_CACHE_COUNT 10 |
| #define | PROGRAM_BINARY_RETRIEVABLE_HINT 0x8257 |
Typedefs | |
| typedef TMap< FOpenGLCompiledShaderKey, FOpenGLCompiledShaderValue > | FOpenGLCompiledShaderCache |
Functions | |
| bool | IsPrecachingEnabled () |
| void | PE_AppendCString (TArray< ANSICHAR > &Dest, const ANSICHAR *Source) |
| void | PE_ReplaceCString (TArray< ANSICHAR > &Dest, const ANSICHAR *Source, const ANSICHAR *Replacement) |
| uint32 | GetTypeHash (FAnsiCharArray const &CharArray) |
| void OPENGLDRV_API | GetCurrentOpenGLShaderDeviceCapabilities (FOpenGLShaderDeviceCapabilities &Capabilities) |
| void OPENGLDRV_API | GLSLToDeviceCompatibleGLSL (FAnsiCharArray &GlslCodeOriginal, const FString &ShaderName, GLenum TypeEnum, const FOpenGLShaderDeviceCapabilities &Capabilities, FAnsiCharArray &GlslCode) |
| bool | UE::OpenGL::CreateGLProgramFromBinary (GLuint &ProgramOUT, const TArrayView< const uint8 > &ProgramBinary) |
| void | DestroyShadersAndPrograms () |
| void | UE::OpenGL::OnGLProgramLoadedFromBinaryCache (const FOpenGLProgramKey &ProgramKey, TUniqueObj< FOpenGLProgramBinary > &&ProgramBinaryData) |
Variables | |
| int32 | GUntouchedProgramEvictTimeSeconds = 0 |
| int32 | GProgramLRUResidentCountBeforeEviction = 300 |
| const uint32 | SizeOfFloat4 = 16 |
| const uint32 | NumFloatsInFloat4 = 4 |
| #define LAST_RELEASED_PROGRAMS_CACHE_COUNT 10 |
| #define OGL_BINARYCACHE_STATS !UE_BUILD_SHIPPING |
| #define OGL_BINARYCACHE_STATS_LOG | ( | ) | if(FOpenGLBinaryCacheStats::IsEnabled()) { FOpenGLBinaryCacheStats::Get().LogStats();} |
| #define OGL_BINARYCACHE_STATS_MARKBEGINCOMPILE | ( | x | ) | if(FOpenGLBinaryCacheStats::IsEnabled()) { FOpenGLBinaryCacheStats::Get().MarkStartTime(x);} |
| #define OGL_BINARYCACHE_STATS_MARKBINARYCACHEMISS | ( | x, | |
| y | |||
| ) | if(FOpenGLBinaryCacheStats::IsEnabled()) { FOpenGLBinaryCacheStats::Get().MarkCacheMissedTime(x,y);} |
| #define OGL_BINARYCACHE_STATS_MARKBINARYCACHEUSE | ( | x | ) | if(FOpenGLBinaryCacheStats::IsEnabled()) { FOpenGLBinaryCacheStats::Get().MarkCacheUse(x);} |
| #define OGL_BINARYCACHE_STATS_MARKCOMPILED | ( | x | ) | if(FOpenGLBinaryCacheStats::IsEnabled()) { FOpenGLBinaryCacheStats::Get().MarkCompileFinishTime(x);} |
| #define PROGRAM_BINARY_RETRIEVABLE_HINT 0x8257 |
| #define VERIFY_GL_SHADER_COMPILE 1 |
| #define VERIFY_GL_SHADER_LINK 1 |
| void DestroyShadersAndPrograms | ( | ) |
| void OPENGLDRV_API GetCurrentOpenGLShaderDeviceCapabilities | ( | FOpenGLShaderDeviceCapabilities & | Capabilities | ) |
Gets the GL device capabilities for the current device.
| Capabilities | [out] The current platform's capabilities on device for shader compiling |
|
inline |
| void OPENGLDRV_API GLSLToDeviceCompatibleGLSL | ( | FAnsiCharArray & | GlslCodeOriginal, |
| const FString & | ShaderName, | ||
| GLenum | TypeEnum, | ||
| const FOpenGLShaderDeviceCapabilities & | Capabilities, | ||
| FAnsiCharArray & | GlslCode | ||
| ) |
Processes the GLSL output of the shader cross compiler to get GLSL that can be compiled on a platform with the specified capabilities. Works around inconsistencies between OpenGL implementations, including lack of support for certain extensions and drivers with non-conformant behavior.
| GlslCodeOriginal | - [in,out] GLSL output from shader cross compiler to be modified. Process is destructive; pass in a copy if still need original! |
| ShaderName | - [in] Shader name |
| TypeEnum | - [in] Type of shader (GL_[VERTEX, FRAGMENT, GEOMETRY, TESS_CONTROL, TESS_EVALUATION]_SHADER) |
| Capabilities | - [in] GL Device capabilities |
| GlslCode | - [out] Compilable GLSL |
| bool IsPrecachingEnabled | ( | ) |
| void PE_ReplaceCString | ( | TArray< ANSICHAR > & | Dest, |
| const ANSICHAR * | Source, | ||
| const ANSICHAR * | Replacement | ||
| ) |
| int32 GProgramLRUResidentCountBeforeEviction = 300 |
| int32 GUntouchedProgramEvictTimeSeconds = 0 |
| const uint32 NumFloatsInFloat4 = 4 |
| const uint32 SizeOfFloat4 = 16 |