Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Jumpman

Problem with VBO on ATI

This topic is 5307 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

over the weekend I bought myself a ATI 9600XT Radeon.. (I had a gf4mx before that) and since then, my model loader has been crashing when setting up the VBO's (which was working fine on the gforce card). Here is the code which allocates the VBO and then feeds it the data (into a display list)..
	int	nVertexCount = m_numTriangles * 3;

	// generate the vertex, texture and normal arrays

	generateArrays();

	// Generate And Bind The Vertex Buffer

	m_pgp->glGenBuffersARB(1, &m_nVBOVertexArray);							// Get A Valid Name

	m_pgp->glBindBufferARB(GL_ARRAY_BUFFER_ARB, m_nVBOVertexArray);			// Bind The Buffer


	// Load The Data (vertices, texture cords, colours and normals)

	m_pgp->glBufferDataARB(GL_ARRAY_BUFFER_ARB, 
						   nVertexCount * sizeof(vaVertexArray),
						   m_pvaVertexArray, 
						   GL_STATIC_DRAW_ARB);

	m_fVBOGenerated = true;

	// generate a display list

	m_vaDisplayList = glGenLists(1);

	if(m_vaDisplayList == 0)
	{
		return;
	}

	glNewList(m_vaDisplayList, GL_COMPILE);

		// Enable all client states we are using.

		glEnableClientState(GL_VERTEX_ARRAY);
		glEnableClientState(GL_TEXTURE_COORD_ARRAY);
#ifndef NO_NORMALS
		glEnableClientState(GL_NORMAL_ARRAY);
#endif
	   
		// Load the data to each pointer type we need.

		m_pgp->glBindBufferARB(GL_ARRAY_BUFFER_ARB, m_nVBOVertexArray);
		glVertexPointer(3, GL_FLOAT, sizeof(vaVertexArray), BUFFER_OFFSET(0));
		glTexCoordPointer(2, GL_FLOAT, sizeof(vaVertexArray), BUFFER_OFFSET(3*sizeof(float)));

#ifndef NO_NORMALS
		glNormalPointer(GL_FLOAT, sizeof(vaVertexArray), BUFFER_OFFSET(5*sizeof(float)));
#endif

		// Draw the entire object.

		glDrawArrays(GL_TRIANGLES, 0, m_numTriangles*3);

		// Disable all the client states we enabled.

		glDisableClientState(GL_VERTEX_ARRAY);
#ifndef NO_NORMALS
		glDisableClientState(GL_NORMAL_ARRAY);
#endif
		glDisableClientState(GL_TEXTURE_COORD_ARRAY);

	// End the list creation.

	glEndList();

	// unbind any buffers

	m_pgp->glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0);
It's crashing on the glDrawArrays command.. any ideas ?? I am using the latest catalyst drivers (3.10) available for download on the ATI site.. Jumpman - Under Construction [edited by - Jumpman on January 6, 2004 2:20:18 AM]

Share this post


Link to post
Share on other sites
Advertisement
I can''t help you with your problem, but I''m just curious: why are you putting VBO inside a DL? This is pretty useless and will slow things down, since for DLs it makes no difference if the data is in the VBO, vertex arrays or even immediate mode.

-Lev

Share this post


Link to post
Share on other sites
well in my initial tests (on the gforce).. there was a significant jump in fps in putting in the enabling client state into a DL..

if I use the same vertex data as an normal vertex array then it works fine (including putting it in a display list).. would like to understand why it''s crashing as VBO''s should really be used if possible..

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
How much data are you trying to load into the VBO? There is a limit but I think it varies by card/driver configuration. Try putting just a few vertices in there and see if it still crashes.

Share this post


Link to post
Share on other sites
i think my largest object has about 1000 vertices , normals, texture cords etc..

will give it a go..

is there anyway to find out the maximum size of a VBO..

Share this post


Link to post
Share on other sites
tried it with just 10 tri''s and it''s still crashing out.. access violation in ATIOGLXX.DLL

bog standard va''s work fine.. hmm..

Share this post


Link to post
Share on other sites
do you have anything enabled usng EnableClientState where you haven''t specfied a pointer to? For instance i know my app crashes if i enable Normal_ARRAY but dont specify the data for it with NormalPointer. Maybe you accidentially enabled one of the other arrays but nevered turned it off ealier in your code; It''s probably not ur problem, but its a shot in the dark. Good luck with ur problem.

Share this post


Link to post
Share on other sites
try something weird and use the normal pointers etc. (everything but vertex pointer) without enabling them. i had some pretty pointless crashes using vbo and fragment programs and for some reason not enabling normal/color arrays but just using them would not just not crash but for some reason even work correctly when it probably shouldnt.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!