![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <OpenGLShaderResources.h>
Public Member Functions | |
| FOpenGLShaderParameterCache () | |
| ~FOpenGLShaderParameterCache () | |
| void | InitializeResources (int32 UniformArraySize) |
| void | MarkAllDirty () |
| void | Set (uint32 BufferIndex, uint32 ByteOffset, uint32 NumBytes, const void *NewValues) |
| void | CommitPackedGlobals (const FOpenGLLinkedProgram *LinkedProgram, CrossCompiler::EShaderStage Stage) |
| void | CommitPackedUniformBuffers (FOpenGLLinkedProgram *LinkedProgram, CrossCompiler::EShaderStage Stage, FRHIUniformBuffer **UniformBuffers, const TArray< CrossCompiler::FUniformBufferCopyInfo > &UniformBuffersCopyInfo) |
Caching of OpenGL uniform parameters.
| FOpenGLShaderParameterCache::FOpenGLShaderParameterCache | ( | ) |
Constructor.
| FOpenGLShaderParameterCache::~FOpenGLShaderParameterCache | ( | ) |
Destructor.
| void FOpenGLShaderParameterCache::CommitPackedGlobals | ( | const FOpenGLLinkedProgram * | LinkedProgram, |
| CrossCompiler::EShaderStage | Stage | ||
| ) |
Commit shader parameters to the currently bound program.
| ParameterTable | - Information on the bound uniform arrays for the program. |
Note that this always uploads the entire uniform array when it is dirty. The arrays are marked dirty either when the bound shader state changes or a value in the array is modified. OpenGL actually caches uniforms per- program. If we shadowed those per-program uniforms we could avoid calling glUniform4?v for values that have not changed since the last invocation of the program.
It's unclear whether the driver does the same thing and whether there is a performance benefit. Even if there is, this type of caching makes any multithreading vastly more difficult, so for now uniforms are not cached per-program.
| void FOpenGLShaderParameterCache::CommitPackedUniformBuffers | ( | FOpenGLLinkedProgram * | LinkedProgram, |
| CrossCompiler::EShaderStage | Stage, | ||
| FRHIUniformBuffer ** | UniformBuffers, | ||
| const TArray< CrossCompiler::FUniformBufferCopyInfo > & | UniformBuffersCopyInfo | ||
| ) |
| void FOpenGLShaderParameterCache::MarkAllDirty | ( | ) |
Marks all uniform arrays as dirty.
| void FOpenGLShaderParameterCache::Set | ( | uint32 | BufferIndexName, |
| uint32 | ByteOffset, | ||
| uint32 | NumBytes, | ||
| const void * | NewValues | ||
| ) |
Sets values directly into the packed uniform array
Set parameter values.