-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

- From time to time people say that they want support for precompiled
shaders in the OpenGL API. The main point for this they bring forth is
reducing loading times for their applications.

I think this advantage of precompiled shaders can be had without support
for it in the API: It can be inmplemented transparently in the driver.

When the application passes a shader source to be compiled to the driver
the driver calculates a cryptographic hash of the source and relevant
settings such a some hints. The driver then looks into it's cache of
compiled shaders for one with the same hash value. If there is one, use
it - no need to compile the source again. If there is none, compile it,
store it in the cache along with the hash value.

There is no additional work for the application programmers to do. They
will automatically receive the benefit of faster application startup.
The driver knows best when it has to recompile (e.g. after a driver
update). The cache size is expected to be rather small, and today's
hard-disks are large.

The cryptographic hash ensures that no application will intentionally or
accidently use shaders from another application.

How much work would it be to implement this in Mesa? Should the shader
cache be made global or per-user?

Philipp

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkk9JbEACgkQbtUV+xsoLpqyiwCg1UiCP8HNfav+yiYI2ISHUWWI
nIcAniGfb8Uztz+pdo+KZhgRja4Gc1iy
=YAEl
-----END PGP SIGNATURE-----

------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
Mesa3d-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to