[vlc-devel] [PATCH] opengl: use buffer objects instead of host memory with glVertexAttribPointer.

Ilkka Ollakka ileoo at videolan.org
Fri Mar 28 07:13:36 CET 2014


On Wed, Mar 26, 2014 at 10:35:49PM +0200, Rémi Denis-Courmont wrote:
> Le mercredi 26 mars 2014, 18:33:56 Felix Abecassis a écrit :
> > Previously, glVertexAttribPointer was called in function
> > DrawWithShaders using an host array (textureCoord) allocated on the
> > stack inside a loop. This caused stack buffer overflow afterwards.

> > See http://www.opengl.org/wiki/Synchronization#Asynchronous_action

> > Array definition could have been hoisted out of the loop but using
> > buffer objects is a better solution since it is now the only option
> > with recent OpenGL versions.


> > +#ifdef SUPPORTS_SHADERS
> > +    vgl->GenBuffers(1, &vgl->vertex_buffer_object);
> > +    vgl->GenBuffers(vgl->chroma->plane_count, vgl->texture_buffer_object);
> > +#endif

> I suspect this jump to NULL if the OpenGL version is less than 1.5...

Isn't the OpenGL 2.0 anyway the oldest version we try to support,
atleast with glsl shaders.

-- 
Ilkka Ollakka
This is a good time to punt work.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: Digital signature
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20140328/41844194/attachment.sig>


More information about the vlc-devel mailing list