#include <ImFusion/GL/GlProgramIncludeManager.h>
Helper class to manage instances of the same base shader with different abstract includes and/or defines.
More...
Helper class to manage instances of the same base shader with different abstract includes and/or defines.
This class is a specialization of GL::ProgramCache adding a convenience overload getProgram(const SharedImage& si, const std::string& additionalDefines).
◆ GlProgramIncludeManager()
Instantiates a GlProgramIncludeManager based on the given reference shader.
- Note
- This constructor will throw if the reference shader invalid (null).
- Parameters
-
| referenceProgram | Reference shader, must not be null. |
| cacheSize | Number of instances that can be cached. Must be greater than 0. |
◆ getProgram() [1/4]
Retrieves the correct shader version w.r.t the given abstract includes.
- Note
- Internally, this function may instantiate a new GL::Program. Therefore, it may throw if it can not instantiate a shader for the given combination.
- Parameters
-
| include1 | First optional abstract include to expand into the reference shader. |
| include2 | Second optional abstract include to expand into the reference shader. |
| additionalDefines | Set of defines inserted into the shader header. |
◆ getProgram() [2/4]
Convenience overload that retrieves the correct shader version w.r.t.
the mask and deformation of the given image.
- Note
- Internally, this function may instantiate a new GL::Program. Therefore, it may throw if it can not instantiate a shader for the given combination.
- Parameters
-
| si | Reference image defining the mask and deformation abstract include to use. |
| additionalDefines | Set of defines inserted into the shader header. |
◆ getProgram() [3/4]
Retrieves the correct shader version w.r.t the given abstract includes.
- Parameters
-
| includes | Vector of abstract includes |
| additionalDefines | Set of defines inserted into the shader header. |
- Exceptions
-
◆ getProgram() [4/4]
Convenience overload that retrieves the shader with the given additional defines but without any additional includes.
- Parameters
-
| additionalDefines | Set of defines inserted into the shader header. |
- Exceptions
-
The documentation for this class was generated from the following file:
- ImFusion/GL/GlProgramIncludeManager.h