graphics - eglCreateImageKHR - texture update via CPU (Zero Copy) -


need pointers on using eglcreateimagekhr & gleglimagetargettexture2does api's avoid cpu gpu memory copy , tried code not sure why texture not getting updated.

here code snippet of application step 1

gluint source; gluint targettexture; glubyte originaldata[4] = {0, 255, 0, 0}; glubyte originaldata[4] = {0, 255, 0, 0}; eglint egl_img_attr[] = {  egl_gl_texture_level_khr, 0, egl_image_preserved_khr, egl_true,}; glgentextures(1, &tex); glbindtexture(gl_texture_2d, tex); //no mipmapping gltexparameteri(gl_texture_2d, gl_texture_mag_filter,gl_nearest); gltexparameteri(gl_texture_2d, gl_texture_min_filter,gl_nearest); glteximage2d(gl_texture_2d, 0, gl_rgb, 1, 1, 0, gl_rgb,  gl_unsigned_byte,originaldata); egl_img = eglcreateimagekhr(egl_dpy,egl_ctx, egl_gl_texture_2d_khr,  (eglclientbuffer)tex, egl_img_attr); //egl handler created 

step 2

gluint targettexture; glgentextures(1, &targettexture); glbindtexture(gl_texture_2d, targettexture); gltexparameteri(gl_texture_2d, gl_texture_wrap_s, gl_repeat); gltexparameteri(gl_texture_2d, gl_texture_wrap_t, gl_repeat); gltexparameteri(gl_texture_2d, gl_texture_mag_filter,gl_nearest); gltexparameteri(gl_texture_2d, gl_texture_min_filter,gl_nearest); gleglimagetargettexture2does(gl_texture_external_oes,  (gleglimageoes)egl_img); gldrawarrays(gl_triangles, 0, 6); 

draws green color texture on screen

step 3

glbindtexture(gl_texture_2d, targettexture); gltexsubimage2d(gl_texture_2d, 0, 0, 0, 1, 1, gl_rgba, gl_unsigned_byte,  updatedata); //trying update texture on fly gldrawarrays(gl_triangles, 0, 6); 

doesnt update texture on screen..., instead "gl error 0x502" thrown on red highlighted line gltexsubimage2d ,

is correct usage of these api's, want update texture on fly..

i using linux environment on mali 400 gpu


Comments

Popular posts from this blog

What is happening when Matlab is starting a "parallel pool"? -

angular - DownloadURL return null in below code -

php - Cannot override Laravel Spark authentication with own implementation -