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: Structs versus Vectors




On May 13, 2008, at 2:10 PM, Richard Somers wrote:

"In general, use the vector forms of commands to pass precomputed data, and use the scalar forms of commands to pass values that are computed near call time."

Does this mean for instance that the scalar forms of commands should be used between glBegin and glEnd and the vector forms should not for best performance?

If this is the case it does not make sense. You would think that the vector form of the command would always be faster because you are passing just a pointer parameter.

Depending on the architecture, it could pass all the arguments of the scalar form in CPU registers. An array of floats on the heap or the stack OTOH would probably get saved from the CPU registers to memory before the GL call and then the GL function itself would have to load it again from there.


Well, that's my guess at least.

-Stefan
_______________________________________________
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: 
 >Structs versus Vectors (From: Richard Somers <email@hidden>)
 >Re: Structs versus Vectors (From: Richard Somers <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.