Re: [patch] gl: cache uniform location
Eric Anholt <[email protected]>
| Newsgroups | gmane.comp.lib.cairo |
|---|---|
| Message-ID | <[email protected]> |
"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
signature.asc
(application/pgp-signature, 197 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAlA1XO0ACgkQHUdvYGzw6vcloACfRylpxLNUBhmbA8YQ5B4cjsuv /DEAn3ASAmVAinyWGJQ7A/vaYAuWnTqp =+yp7 -----END PGP SIGNATURE-----