Re: [patch] gl: cache uniform location

"Henry (Yu) Song - SISA" <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <3955FA337689574EB32F94B12A7E6E9E246B0F23@sisaex01sj>
Thanks Eric, you are right on the performance. 

Henry

________________________________________
From: Eric Anholt [[email protected]]
Sent: Wednesday, August 22, 2012 3:27 PM
To: Henry (Yu) Song - SISA; [email protected]
Subject: Re: [cairo] [patch] gl: cache uniform location

"Henry (Yu) Song - SISA" <[email protected]> writes:

> GetUniformLocation is expensive call, especially on embedded device,  we can cache them once obtained.
>
> From c856118e637412a8c5cd7b68cc569f7e1bf4f44c Mon Sep 17 00:00:00 2001
> From: Henry Song <[email protected]>
> Date: Fri, 6 Jan 2012 16:46:25 -0800
> Subject: [PATCH] gl/msaa: Cache shader uniform locations
>
> Instead of continuously fetching the uniform locations from compiled
> shaders, cache them.

This should be basically as expensive as glGetUniformLocation, since
that's a hash lookup too.  I suspect you can't measure a performance
difference from this particular change.

Also, it looks broken, since the newly introduced static function doing
the work isn't referenced.

If you're interested in pursuing and benchmarking this, I would
recommend doing getuniformlocation once at program link time, then
saving the integer locations in the cairo_gl_shader_t instead of asking
for them by name in the future.
-- 
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.