Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: glGetInteger cost?



On Nov 8, 2007, at 9:45 AM, Dan Herman wrote:
I'm sure I know the answer, but I haven't been doing deep OpenGL coding for so long I'm doubting myself. Does...

	GLint viewport[4];
	glGetIntegerv( GL_VIEWPORT, viewport );

... cause the CPU to wait for the gl command buffer to clear?

Indeed it would. It doesn't cause the entire GPU pipeline to drain (like glReadPixels, for example) but would require the command buffers in the server to be processed before you get your answer.


I advocate shadowing the state you'd be querying via glGet*, glIsEnabled(), etc. whenever you can. But in cases where these calls are necessary, try to group them temporally so there's only one meaningful "drain" point. Having them sprinkled around the frame is a worse hit.

Allan
___________

Allan Schaffer
Graphics Evangelist
Worldwide Developer Relations



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Mac-opengl mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/mac-opengl/email@hidden

This email sent to email@hidden
References: 
 >glGetInteger cost? (From: Dan Herman <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.