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

Function initGLBuffers

cpp/5_Domain_Specific/postProcessGL/main.cpp:917–943  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

915//!
916////////////////////////////////////////////////////////////////////////////////
917void initGLBuffers()
918{
919// create pbo
920#ifdef USE_TEXSUBIMAGE2D
921 createPBO(&pbo_dest, &cuda_pbo_dest_resource);
922#endif
923 // create texture that will receive the result of CUDA
924 createTextureDst(&tex_cudaResult, image_width, image_height);
925
926 // create texture for blitting onto the screen
927 createTextureSrc(&tex_screen, image_width, image_height);
928 // createRenderBuffer(&tex_screen, image_width, image_height); // Doesn't work
929
930 // create a depth buffer for offscreen rendering
931 createDepthBuffer(&depth_buffer, image_width, image_height);
932
933 // create a framebuffer for offscreen rendering
934 createFramebuffer(&framebuffer, tex_screen, depth_buffer);
935
936 // load shader programs
937 shDrawPot = compileGLSLprogram(NULL, glsl_drawpot_fragshader_src);
938
939#ifndef USE_TEXSUBIMAGE2D
940 shDrawTex = compileGLSLprogram(glsl_drawtex_vertshader_src, glsl_drawtex_fragshader_src);
941#endif
942 SDK_CHECK_ERROR_GL();
943}
944
945////////////////////////////////////////////////////////////////////////////////
946//! Run standard demo loop with or without GL verification

Callers 1

runStdProgramFunction · 0.70

Calls 6

createTextureSrcFunction · 0.85
createDepthBufferFunction · 0.85
createFramebufferFunction · 0.85
createPBOFunction · 0.70
createTextureDstFunction · 0.70
compileGLSLprogramFunction · 0.70

Tested by

no test coverage detected