------------------------------------------------------------------------------ Releases the current shader program if it is inconsistent with the GL2PS capture state. Returns the current OpenGLGL2PSHelper instance if one exists.
| 138 | // Releases the current shader program if it is inconsistent with the GL2PS |
| 139 | // capture state. Returns the current OpenGLGL2PSHelper instance if one exists. |
| 140 | vtkOpenGLGL2PSHelper* PrepProgramForGL2PS(vtkOpenGLHelper& helper) |
| 141 | { |
| 142 | vtkOpenGLGL2PSHelper* gl2ps = vtkOpenGLGL2PSHelper::GetInstance(); |
| 143 | if (gl2ps && gl2ps->GetActiveState() == vtkOpenGLGL2PSHelper::Capture) |
| 144 | { |
| 145 | // Always recreate the program when doing GL2PS capture. |
| 146 | if (helper.Program) |
| 147 | { |
| 148 | helper.ReleaseGraphicsResources(nullptr); |
| 149 | } |
| 150 | } |
| 151 | else |
| 152 | { |
| 153 | // If there is a feedback transform capturer set on the current shader |
| 154 | // program and we're not capturing, recreate the program. |
| 155 | if (helper.Program && helper.Program->GetTransformFeedback()) |
| 156 | { |
| 157 | helper.ReleaseGraphicsResources(nullptr); |
| 158 | } |
| 159 | } |
| 160 | |
| 161 | return gl2ps; |
| 162 | } |
| 163 | |
| 164 | //------------------------------------------------------------------------------ |
| 165 | // Call before glDraw* commands to ensure that vertices are properly captured |
no test coverage detected