CUDAとVBO
をテンプレートにして作成
[
トップ
|
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
]
開始行:
#code(C,nonumber){{
cudaError_t cudaGLRegisterBufferObject(GLuint bufObj);
cudaError_t cudaGLUnregisterBufferObject(GLuint bufObj);
}}
#code(C,nonumber){{
cudaError_t cudaGLMapBufferObject(void **devPtr, GLuint b...
cudaError_t cudaGLUnmapBufferObject(GLuint bufObj);
}}
[[cudaGLRegisterBufferObject:http://developer.download.nv...
[[cudaGLMapBufferObject:http://developer.download.nvidia....
[[cudaGLUnmapBufferObject:http://developer.download.nvidi...
[[cudaGLUnregisterBufferObject:http://developer.download....
#code(C){{
GLuint vbo;
glGenBuffers(1, &vbo);
glBindBuffer(GL_ARRAY_BUFFER, vbo);
glBufferData(GL_ARRAY_BUFFER, size, 0, GL_DYNAMIC_DRAW);
glBindBuffer(GL_ARRAY_BUFFER, 0);
cutilSafeCall(cudaGLRegisterBufferObject(vbo));
float *dPtr;
cutilSafeCall(cudaGLMapBufferObject(&dPtr, vbo));
cutilSafeCall(cudaGLUnmapBufferObject(vbo));
cutilSafeCall(cudaGLUnregisterBufferObject(vbo));
glDeleteBuffers(1, (const GLuint*)&vbo);
}}
終了行:
#code(C,nonumber){{
cudaError_t cudaGLRegisterBufferObject(GLuint bufObj);
cudaError_t cudaGLUnregisterBufferObject(GLuint bufObj);
}}
#code(C,nonumber){{
cudaError_t cudaGLMapBufferObject(void **devPtr, GLuint b...
cudaError_t cudaGLUnmapBufferObject(GLuint bufObj);
}}
[[cudaGLRegisterBufferObject:http://developer.download.nv...
[[cudaGLMapBufferObject:http://developer.download.nvidia....
[[cudaGLUnmapBufferObject:http://developer.download.nvidi...
[[cudaGLUnregisterBufferObject:http://developer.download....
#code(C){{
GLuint vbo;
glGenBuffers(1, &vbo);
glBindBuffer(GL_ARRAY_BUFFER, vbo);
glBufferData(GL_ARRAY_BUFFER, size, 0, GL_DYNAMIC_DRAW);
glBindBuffer(GL_ARRAY_BUFFER, 0);
cutilSafeCall(cudaGLRegisterBufferObject(vbo));
float *dPtr;
cutilSafeCall(cudaGLMapBufferObject(&dPtr, vbo));
cutilSafeCall(cudaGLUnmapBufferObject(vbo));
cutilSafeCall(cudaGLUnregisterBufferObject(vbo));
glDeleteBuffers(1, (const GLuint*)&vbo);
}}
ページ名: