MCPcopy Create free account
hub / github.com/Kitware/VTK / ReadyLinesCBOProgram

Method ReadyLinesCBOProgram

Rendering/ContextOpenGL2/vtkOpenGLContextDevice2D.cxx:570–599  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

568}
569
570void vtkOpenGLContextDevice2D::ReadyLinesCBOProgram()
571{
572 vtkOpenGLGL2PSHelper* gl2ps = PrepProgramForGL2PS(*this->LinesCBO);
573
574 if (!this->LinesCBO->Program)
575 {
576 vtkTransformFeedback* tf = nullptr;
577 if (gl2ps && gl2ps->GetActiveState() == vtkOpenGLGL2PSHelper::Capture)
578 {
579 tf = vtkTransformFeedback::New();
580 tf->AddVarying(vtkTransformFeedback::Vertex_ClipCoordinate_F, "gl_Position");
581 tf->AddVarying(vtkTransformFeedback::Color_RGBA_F, "vertexColor");
582 }
583 std::string vs = "//VTK::System::Dec\n#define haveColors\n#define haveLines\n";
584 vs += myVertShader;
585 std::string fs = "//VTK::System::Dec\n#define haveColors\n#define haveLines\n";
586 fs += myFragShader;
587 this->LinesCBO->Program =
588 this->RenderWindow->GetShaderCache()->ReadyShaderProgram(vs.c_str(), fs.c_str(), "", tf);
589 if (tf)
590 {
591 tf->Delete();
592 tf = nullptr;
593 }
594 }
595 else
596 {
597 this->RenderWindow->GetShaderCache()->ReadyShaderProgram(this->LinesCBO->Program);
598 }
599}
600
601void vtkOpenGLContextDevice2D::ReadyVTBOProgram()
602{

Callers 2

DrawPolyMethod · 0.95
DrawLinesMethod · 0.95

Calls 7

PrepProgramForGL2PSFunction · 0.85
AddVaryingMethod · 0.80
GetShaderCacheMethod · 0.80
DeleteMethod · 0.65
NewFunction · 0.50
ReadyShaderProgramMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected