MCPcopy Create free account
hub / github.com/NVIDIA/cuda-samples / initGLBuffers

Function initGLBuffers

cpp/0_Introduction/simpleCUDA2GL/main.cpp:629–644  ·  view source on GitHub ↗

/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

627//!
628////////////////////////////////////////////////////////////////////////////////
629void initGLBuffers()
630{
631// create pbo
632#ifdef USE_TEXSUBIMAGE2D
633 createPBO(&pbo_dest, &cuda_pbo_dest_resource);
634#endif
635 // create texture that will receive the result of CUDA
636 createTextureDst(&tex_cudaResult, image_width, image_height);
637 // load shader programs
638 shDraw = compileGLSLprogram(NULL, glsl_draw_fragshader_src);
639
640#ifndef USE_TEXSUBIMAGE2D
641 shDrawTex = compileGLSLprogram(glsl_drawtex_vertshader_src, glsl_drawtex_fragshader_src);
642#endif
643 SDK_CHECK_ERROR_GL();
644}
645
646////////////////////////////////////////////////////////////////////////////////
647//! Run standard demo loop with or without GL verification

Callers 1

runStdProgramFunction · 0.70

Calls 3

createPBOFunction · 0.70
createTextureDstFunction · 0.70
compileGLSLprogramFunction · 0.70

Tested by

no test coverage detected