Share

Sh GPU Metaprogramming Language

File Release Notes and Changelog

Release Name: 0.7.9

Notes:
This release is mostly aimed at improving spec compliance towards the first
0.8 stable release.  Please note that Sh is now released under the terms of
the GNU Lesser General Public License (see http://libsh.org/COPYING.html).

The main new feature in this release is mipmapping.  It is now enabled by
default on ShTexture objects so that current programs will use it
automatically.  We also provide two templates that you can wrap around your
texture objects to enable/disable mipmapping: ShNoMIPFilter and ShMIPFilter.

There are two ways to generate the mipmap levels.  Manually, by setting each
memory level separately:
       texture.memory(image.memory());
       texture.memory(image1.memory(), 1);
       texture.memory(image2.memory(), 2);
       ...
and automatically, either by not doing anything and letting Sh do it at bind
time, or by calling "texture.build_mipmaps()" explicitly.  See the
"textures" example for a sample implementation.

ShException now inherits from std::exception so that you can catch both
kinds of exceptions in a single statement:
  try {
    ...
  } catch (const std::exception& e) {
    std::cerr << e.what() << std::endl;
  }

In addition to UNIX makefiles and Visual Studio project files, OSX users
will now find an Xcode project file under the xcode/ directory.  This can be
used to easily build a native OSX framework.  Note that OSX compatibility
for the UNIX makefiles is now deprecated.

A few new optimizations were added which may improve performance on programs
that use branching.  Another improvement to the ARB backend is the ability
to use generic binding for vertex inputs.

New API functions:

- inverse hyperbolic functions: ACOSH, ASINH and ATANH

- noise functions: hash(), texhash(), noise(), snoise(), linnoise(),
  slinnoise(), cellnoise(), scellnoise(), perlin(), sperlin(), turbulence()
  and sturbulence()

- scalar versions of join, lerp, mad and cond that work with non-Sh types

- matrix multiplication and matrix-tuple multiplication functions that
  perform matrix/tuple expansion when necessary

- shComment() allows generated ARB and GLSL shaders to include user comments
  that will not be stripped out by the Sh compiler

Shrike now works both on the GLSL backend and with Unicode-enabled
wxWindows.  A few more Sh bugs on ATI cards or OSX were also fixed. 

There are a few known issues for this release:

- Mipmapped cubemaps are really slow, please turn off mipmapping on cubemaps
  for the time being (ShNoMIPFilter<ShTextureCube<...> > texture)

- ATAN is not implemented in the ARB backend.

- Unit tests: "sign" and "trig" unit tests currently fail on ARB,
  "tex" fails on CC.

As always, please report any other issues on our mailing list
(http://lists.libsh.org/cgi-bin/mailman/listinfo/libsh-users) or use our
issue tracker (http://issues.libsh.org/).

Thanks,

- The Sh Team

Changes: 2005-07-27 Andrew Lauritzen <atlaurit@localhost.localdomain> * src/ShMatrix.hpp: Added "rows" and "cols" static variables to ShMatrix set to the corresponding template parameters. 2005-07-27 Stefanus Du Toit <sdt@serioushack.com> * src/ShOptimizations.cpp: Added redundant edge removal optimization. * src/ShLibMatrixImpl.hpp: Add hack for MSVC which cannot handle as beefy template matching as gcc, in particular for operator| and operator* for matrices with special types. * src/ShLibMatrix.hpp: Remove #ifndef WIN32 which for some strange reason was there. 2005-07-27 Francois Marier <francois@serioushack.com> * src/ShLibMatrixImpl.hpp (operator|): Support non-square matrices in the expanded matrix-tuple products. * src/ShLibMiscImpl.hpp, ShLibMisc.hpp (join): Add support for scalars in the 2-argument version of join. * src/ShLibArithImpl.hpp (lerp): Fix the support for scalars. (mad): Fix the support for scalars. * src/ShLibMatrixImpl.hpp, ShLibMatrix.hpp: Optimize the matrix-tuple product for SH_VECTOR and SH_NORMAL. Make the matrix-tuple expansion work as intended by returning the same semantic type and size as the argument. 2005-07-27 Stefanus Du Toit <sdt@serioushack.com> * src/ShOptimizations.cpp: Added empty block removal optimization, enabled by default. * src/ShStructural.hpp: Removed comment about IF being unused cause it isn't anymore. * src/ShStructural.cpp: Handle IF nodes. * backends/gl/ArbCode.cpp: Handle IF nodes in structural analysis. * backends/gl/GlslCode.cpp: Handle IF nodes in structural analysis. 2005-07-26 Francois Marier <francois@serioushack.com> * src/ShLibBooleanImpl.hpp, ShLibBoolean.hpp (cond): Adding a version of cond where the first parameter doesn't have to be an Sh type. * src/ShLibNormal.hpp, ShLibPoint.hpp, ShLibVector.hpp, ShLibTexCoord.hpp: Remove unnecessary expansion methods. * src/ShLibMatrixImpl.hpp, ShLibMatrix.hpp (operator|): Add tuple-expansion for this operator as well. * src/ShLibMatrixImpl.hpp, ShLibMatrix.hpp (operator*): Add tuple expansion for matrix-tuple multiplication of certain semantic types. * backends/gl/ArbEmit.cpp (emit_tex): Fix a bug in the LUMINANCE_ALPHA special case so that texture lookups work with 2-component variables. 2005-07-25 Francois Marier <francois@serioushack.com> * src/ShLibNoise.hpp, ShLibNoiseImpl.hpp: Add a dummy texhash() function (it just calls hash() right now). 2005-07-22 Francois Marier <francois@serioushack.com> * src/ShOperation.hpp, ShOperation.cpp: Add IR operations for the inverse hyperbolic functions. * src/ShLibTrigImpl.hpp, ShLibTrig.hpp, ShInstructions.hpp: Add library functions for the inverse hyperbolic functions. * src/ShTransformer.hpp, ShTransformer.cpp: Add implementations for the inverse hyperbolic functions and for ATAN2. * backends/cc/CcEmit.cpp, src/ShConcreteCTypeOp.cpp, ShConcreteRegularOpImpl.hpp: Fix the ATAN2 mapping to agree with the book. * src/ShConcreteCTypeOpImpl.hpp, ShEvalImpl.hpp, ShConcreteCTypeOp.cpp backends/cc/CcEmit.cpp, ShInstructions.cpp, ShConcreteRegularOpImpl.hpp: Add mappings for the inverse hyperbolic functions. * backends/gl/ArbCode.cpp, GlslCode.cpp (generate): Call the tranformers to expand ATAN2 and the inverse hyperbolic functions. * src/ShTransformer.cpp (struct DummyOpStripperBase): Fix the dummy op stripper so that the changes are not ignored (m_changed = true). 2005-07-21 Francois Marier <francois@serioushack.com> * src/ShLibNoise.hpp: Add the hash() function and move cellnoise and scellnoise in the same section. * src/ShLibNoiseImpl.hpp: Add hash() and rename all calls to hashmrg() to calls to the new function. * src/ShOperation.cpp, ShOperation.hpp, ShEvalImpl.hpp: Add the NOISE and HASH IR operations. * src/ShInstructions.cpp, ShInstructions.hpp: Add shHASH(). * src/ShConcreteCTypeOpImpl.hpp, ShConcreteRegularOpImpl.hpp: Add dummy implementations for NOISE and HASH. * backends/gl/GlslEmit.cpp, GlslCode.hpp: Add a real implementation of the NOISE IR operation using the noise[1234]() glsl function. * util/ShFunc.hpp, ShFunc.cpp: Remove hashmrg() since it has been moved into the core. 2005-07-20 Francois Marier <francois@serioushack.com> * src/ShLibNoise.hpp, ShLibNoiseImpl.hpp: Add dummy implementations of noise(), snoise(), linnoise() and slinnoise(). * src/ShLibWorleyImpl.hpp (operator()): Remove frac() since issue58 is resolved. * src/ShLib.hpp: Add ShLibNoise.hpp and ShLibWorley to the include list. * src/ShGenericImpl.hpp, ShBaseTextureImpl.hpp: Remove the unnecessary include of ShLib.hpp. * src/ShMatrixImpl.hpp: Include ShLibMisc.hpp. * src/ShLibMisc.hpp, ShLibGeometry.hpp, ShLibMatrix.hpp, ShLibArith.hpp, ShLibClamp.hpp, ShLibTrig.hpp, ShLibDeriv.hpp, ShLibBoolean.hpp: Move the ShLib.hpp include before the header guard to guarantee that the file will be included by ShLib.hpp, not the other way around. This is necessary because some macros are undefined by ShLib. * src/ShLibMiscImpl.hpp: Move sort() after groupsort() since sort() calls groupsort(). * src/ShLibWorley.hpp, ShLibWorleyImpl.hpp, ShLibNoise.hpp, ShLibNoiseImpl.hpp: Create these files from the related files under util/. * ShNoiseImpl.hpp, ShWorleyImpl.hpp, shutil.hpp, ShNoise.hpp, ShWorley.hpp, Makefile.am: Remove the noise and worley code since it is now part of the core. 2005-07-12 Andrew Lauritzen <atlaurit@localhost.localdomain> * src/ShInternals.*: Add a utility class for tracking variable transformations (while compiling, etc). * backends/gl/ArbCode.hpp: Added "generic" binding support for vertex shader inputs if requested (by metadata). Resolves issue100 for the ARB backend. 2005-07-12 Stefanus Du Toit <sdt@serioushack.com> * src/ShLibGeometry.hpp: Document sane convention for refract() parameters. * src/ShLibGeometryImpl.hpp: Change refract() to conform to a sane convention for its inputs. Resolves issue200. * backends/gl/ArbEmit.cpp: Better implementation of SGN. 2005-07-12 Andrew Lauritzen <atlaurit@localhost.localdomain> * src/ShProgramNode.cpp (clone): Cloning ShProgramNodes now copies metadata. 2005-07-08 Francois Marier <francois@serioushack.com> * backends/gl/GlslCode.cpp (real_update_uniform): Removing the unknown uniform message. * util/ShNoiseImpl.hpp (turbulence): Add a missing return statement. * backends/gl/GlslVariableMap.cpp (GlslVariableMap): Allocate GlslVariables for the uniforms. * backends/gl/PBufferStreams.cpp (execute): Only print the fragment program when SH_DEBUG_PBS_PRINTFP is defined. * src/ShAlgebra.cpp (connect): Add a missing collectVariables(). (combine): Add a missing collectVariables(). 2005-07-07 Francois Marier <francois@serioushack.com> * backends/gl/ArbCode.cpp: Map result.depth to SH_POSITION variables only to avoid generic mappings. * add_libsh_copyright_notice.pl, COPYING, *.cpp, *.hpp: Change the license and copyright notices to the GNU LGPL. * src/ShException.cpp, ShException.hpp: Make ShException inherit from std::exception and add a what() method so that ShExceptions can be handled in the same way as regular C++ exceptions. 2005-07-06 Francois Marier <francois@serioushack.com> * src/ShTextureNode.cpp, ShTextureNode.hpp (build_mipmaps): Only build one face of the cube map at a time (takes an extra optional parameter). Fix the base memory pointer for cube maps. * backends/gl/GlTextures.cpp (bindTexture): Give the proper target for cube map mipmap levels. 2005-07-05 Francois Marier <francois@serioushack.com> * src/ShTextureNode.cpp (initialize_memories): Make a copy of all the base textures (one per face for cube maps). * src/ShTextureNode.hpp: Remove the (now) useless base_memory parameter. Adding mipmapping support in ShTextures: * backends/gl/GlTextureStorage.cpp: Specify the mipmap level when transfering textures to the graphics card. Add the mipmap_level parameter to the constructor. * backends/gl/GlTextureStorage.hpp: Add a mipmap_level parameter to the constructor. Add the mipmap_level() method. Add the m_mipmap_level member. * backends/gl/GlTextures.cpp (shGlFormat): Replace a comment by an assertion. (bindTexture): Create extra GLStorage for the mipmap levels if it is enabled. * backends/gl/GlTextureName.cpp (params): Turn on mipmapping if it is set in the traits. * src/ShTextureNode.hpp: Add m_mipmap_levels and m_nb_memories. Add the mipmap_level parameter to the memory() methods. Remove SH_FILTER_MIPMAP and replace it with SH_FILTER_MIPMAP_NEAREST and SH_FILTER_MIPMAP_LINEAR. Add the mipmap_levels() and build_mipmaps() public methods. * src/ShTextureNode.cpp: Add interpolation methods to generate mipmaps automatically. Reinitialize the memories when the texture size is changed. Add the mipmap_level parameter to the memory() methods. Add the mipmap_levels() and build_mipmaps() public methods. * src/ShTexture.hpp: Make the default mipmap filtering be linear. * src/ShBaseTextureImpl.hpp, ShBaseTexture.hpp: Add the mipmap_level parameter to all memory() methods. Add the build_mipmaps() public method. * src/ShMIPFilter.hpp: New file containing the ShNoMIPFilter and ShMIPFilter templates. * src/sh.hpp: Include ShMIPFilter.hpp * backends/cc/Cc.cpp, backends/gl/Utils.cpp, PBufferStreams.cpp: Add the mipmap_level to the memory() calls. * win32/Sh.vcproj, src/Makefile.am, src/Makefile.win32: Add ShMIPFilter.hpp to the project and makefiles. * test/regress/tex.cpp.py: Make all the textures be non-mipmapped for now. * configure.ac, examples/Makefile.am, examples/mipmap/*: Add the mipmap example to test that mipmap is working correctly. * examples/textures/*: Turn on mipmapping in the diffuse textures and off in the specular textures. One texture, default, will provide all the images for the mipmap levels while the other one, rust, will let Sh generate them. 2005-07-05 Stefanus Du Toit <sjdutoit@uwaterloo.ca> * src/ShRefCount.hpp (class ShPointer): Use Boost's unspecified_bool_type trick to allow implicit conversion to bool but nothing else. 2005-06-27 Stefanus Du Toit <sjdutoit@uwaterloo.ca> * backends/cc/Cc.cpp (load_shader_func): Use -bundle on OSX instead of -shared. Fixes issue196. * backends/gl/ArbBackend.cpp (shBackend_libsharb_target_cost): Indicate that we cannot run stream programs on OSX yet. * backends/gl/GlslBackend.cpp (shBackend_libshglsl_target_cost): Indicate that we cannot run stream programs on OSX yet. * examples/particle/Camera.cpp: Copy from glut example for OSX fixes. * examples/particle/main.cpp (gprintf): Use GLint instead of int for viewport variable. Correct headers for OSX. * examples/particles/Makefile.am (LDADD): Use GLUT_LIBS and GL_LIBS for cross-platform compilation (osx in particular). 2005-06-22 Francois Marier <francois@serioushack.com> * backends/cc/Cc.cpp (load_shader_func): Remove the -shared parameter on OSX (patch from evan AT dogboy DOT org). 2005-06-21 Francois Marier <francois@serioushack.com> * backends/gl/GlslCode.hpp, GlslEmit.cpp (emit_comment): Add this method. * backends/gl/GlslEmit.cpp (emit): Add support for the SH_OP_COMMENT operation. * backends/cc/Cc.cpp, Cc.hpp (delete_temporary_files): Add this method to delete the temporary files created before execution. (execute): Call delete_temporary_files() once execution is done. (generate): Move the library loading code to load_shader_func. (load_shader_func): Add this method. * src/ShMemory.hpp, ShMemory.cpp (dirtyall): Use increment_timestamp to update the memory timestamp and to correctly handle out-of-sync objects. (increment_timestamp): Add this method to replace updateTimestamp. (updateTimestamp): Remove this method. * src/ShLibMatrixImpl.hpp, ShLibMatrix.hpp (operator|): Expand matrices if their sizes are not compatible. (operator*): Allow matrices of incompatible sizes * src/ShLibGeometryImpl.hpp, ShLibGeometry.hpp (dot): Allow vectors of different sizes and return an ShException in that case. This is necessary for the matrix expansion changes. * src/test/regress/common.py: Add a matrix_expansion function. * src/ShMatrix.hpp, ShMatrixImpl.hpp: Remove unused copy constructor. * src/ShMemory.cpp, ShMemory.hpp (value_type): When changing the value type, also update the size. 2005-06-17 Francois Marier <francois@serioushack.com> * backends/gl/ArbEmit.cpp (emit_eq): Fix emit_eq so that it works when emitting SNE. This will fix the issue of SNE not working on ATI. * src/ShImage.hpp (load_PNG): Add this function with a deprecated comment because it is mentionned in one of the examples of the book. 2005-06-16 Francois Marier <francois@serioushack.com> * backends/gl/Glsl.hpp, Glsl.cpp: Rename unbind_all() to unbind_all_programs().