On Fri, 2009-08-14 at 17:04 +0700, Hieu Le Trung wrote: > Robert, > > I'm sure that my CPU does not have FPU so that it may cause performance > bottle neck if using floating point math. > Is there any guide on adding Fixed Point support for Clutter? Or is > there any document that list out the part of Clutter which is currently > using Floating Point math?
I think the right way to approach is is via profiling data. It's quite possible that even with *software* floating point fallbacks your application will still run adequately depending on the nature of your Clutter scenes. Depending on the overall design of your platform there may be other aspects that will cause the bottleneck to something else entirely, but you wont know until you try it out. Even if it does turn out to be a problem then you probably don't need to convert everything to use fixed point, there should only be a few performance critical paths involving floating point. There is no guide for this. The most likely place that it will be a problem is the transformations done in cogl-primitives.c, in the Cogl journal. By default we transform geometry that gets logged in this journal on the CPU so that we can batch more together with a single modelview matrix. Assuming your GPU does hardware vertex transforms you may want to experiment with disabling this software transform using COGL_DEBUG=disable-software-transform. The CoglMatrix API could also be an issue for you too. kind regards, - Robert > > Regards, > -Hieu > > -----Original Message----- > From: Robert Bragg [mailto:[email protected]] > Sent: Thursday, August 13, 2009 12:09 AM > To: Hieu Le Trung > Cc: [email protected] > Subject: RE: [clutter] Clutter Fixed Point API > > On Wed, 2009-08-12 at 00:28 +0700, Hieu Le Trung wrote: > > Robert, > > > > Thanks for your information. So in case I need to run Clutter on non > > FPU platform, I must spend effort on porting it? Why is it named Fixed > > Point API :) > > I'm assuming you are talking about Clutter 1.0 here? The only think that > should be "named Fixed Point API" is the CoglFixed utility API. > > The CoglFixed typedef and utility API are the only things left that > support fixed point maths. They can be used by applications for > optimizations if they want, but the rest of Clutter and Cogl only > accepts single precision floats. > > All calculations internal to Clutter will be done using floating point > so if your profiling shows that any of them are a bottleneck you may > need to patch Clutter to implement some fixed point fast-paths, and > accept the loss or precision and range implied. > > I would strongly recommend that you profile your application before > assuming what effort is involved. There are many factors that may affect > your applications performance and the cost of soft float on your > platform may not be a problem depending on the complexity of the scenes > you are painting. > > kind regards, > - Robert > -- Robert Bragg, Intel Open Source Technology Center -- To unsubscribe send a mail to [email protected]
