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

Method ReadyVCBOProgram

Rendering/ContextOpenGL2/vtkOpenGLContextDevice2D.cxx:509–538  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

507}
508
509void vtkOpenGLContextDevice2D::ReadyVCBOProgram()
510{
511 vtkOpenGLGL2PSHelper* gl2ps = PrepProgramForGL2PS(*this->VCBO);
512
513 if (!this->VCBO->Program)
514 {
515 vtkTransformFeedback* tf = nullptr;
516 if (gl2ps && gl2ps->GetActiveState() == vtkOpenGLGL2PSHelper::Capture)
517 {
518 tf = vtkTransformFeedback::New();
519 tf->AddVarying(vtkTransformFeedback::Vertex_ClipCoordinate_F, "gl_Position");
520 tf->AddVarying(vtkTransformFeedback::Color_RGBA_F, "vertexColor");
521 }
522 std::string vs = "//VTK::System::Dec\n#define haveColors\n";
523 vs += myVertShader;
524 std::string fs = "//VTK::System::Dec\n#define haveColors\n";
525 fs += myFragShader;
526 this->VCBO->Program =
527 this->RenderWindow->GetShaderCache()->ReadyShaderProgram(vs.c_str(), fs.c_str(), "", tf);
528 if (tf)
529 {
530 tf->Delete();
531 tf = nullptr;
532 }
533 }
534 else
535 {
536 this->RenderWindow->GetShaderCache()->ReadyShaderProgram(this->VCBO->Program);
537 }
538}
539
540void vtkOpenGLContextDevice2D::ReadyLinesBOProgram()
541{

Callers 2

DrawPointsMethod · 0.95
CoreDrawTrianglesMethod · 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