Diligent Engine
 
Loading...
Searching...
No Matches
Diligent::SerializationDeviceGLInfo Struct Reference

Serialization device attributes for OpenGL backend. More...

#include <ArchiverFactory.h>

Public Attributes

Bool OptimizeShaders = True
 Whether to optimize OpenGL shaders.
 
Bool ZeroToOneClipZ = False
 

Detailed Description

Serialization device attributes for OpenGL backend.

Member Data Documentation

◆ OptimizeShaders

Bool Diligent::SerializationDeviceGLInfo::OptimizeShaders = True

Whether to optimize OpenGL shaders.

Remarks
In OpenGL backend, shaders are stored as source code in the archive. The source code can be rather large since all included files are inlined, helper shader definitions are added, etc. Compiling such shaders may take a significant amount of time, in particular on mobile devices and WebGL. When OptimizeShaders is set to true, the archiver will optimize the shader source code for run-time loading performance.
Technical details: the archiver will compile the shader source code to SPIRV with GLSLang and then translate SPIRV back to GLSL using SPIRV-Cross. The resulting GLSL code will be much more compact and will be stored in the archive instead of the original source code.

◆ ZeroToOneClipZ

Bool Diligent::SerializationDeviceGLInfo::ZeroToOneClipZ = False

Whether to use zero-to-one clip-space Z range.

Remarks
In OpenGL, the default clip-space Z range is -1 to 1. When this flag is set to True, the archiver will assume that the shaders use zero-to-one clip-space Z range.