PDA

View Full Version : Quickie: Where best to store indices?



DanielHawson
06-19-2003, 05:58 AM
When drawing primitives with glDrawElements, and passing it an array of indices, should the index array be stored in video/AGP memory, along with the vertex positions, normals, UVs, and colours, or should it be stored in system meory? In other words, is it the CPU or the GPU that need fast access to the indices?

mdog1234
06-19-2003, 06:29 AM
store it in video memory and then tell me how you did it http://www.opengl.org/discussion_boards/ubb/smile.gif

M/\dm/\n
06-19-2003, 07:16 AM
In vbo you can create element_array, and driver finds the best place to store your array of indices, not necesarily in the same place as v/n/uv's

DanielHawson
06-20-2003, 02:38 AM
Originally posted by mdog1234:
store it in video memory and then tell me how you did it http://www.opengl.org/discussion_boards/ubb/smile.gif

I'd have done it the same way I store my vertex data: wglAllocateMemoryNV(...video/AGP memory, please...), then set my indices pointer to point to a part of the allocated memory, write my indices there, then use that pointer when calling glDrawElements.