Sh 0.8.0rc0 Release Notes: Codename Andechs
This marks the first release candidate for Sh 0.8, a milestone aimed at reaching feature completeness and locking in a stable ABI. Broad testing of this candidate is encouraged so that the final 0.8.0 release can be as dependable as possible. After 0.8.0 ships, subsequent 0.8.x versions will preserve API/ABI compatibility, while a fresh 0.9.x development branch will open for changes that break the API/ABI.
The codename Andechs nods to the brewery tradition referenced at the Andechs brewery site.
What's New in This Candidate
- Generic input binding is now supported on the arb and glsl backends.
- The ATI draw buffers extension is supported on the glsl backend (it was already present on arb).
- Nibbles are available for every library function.
- New ShProgram iterators walk all uniforms, including recursively dependent ones: begin_all_parameters() and end_all_parameters().
- Three control flow statements were introduced: SH_RETURN, SH_BREAK and SH_CONTINUE.
- Several new library functions arrived: atan(), bezier(), ShProgram::describe_bindings(), bernstein<N>() (a dummy function for N != 4), hermite() (dummy), noise, linnoise, slinnnoise and snoise (dummy), plus texhash (dummy). The dummy functions are planned for completion in point releases after 0.8.0.
- Uniform update methods on the arb and glsl backends received optimizations, credited to Andrew Lauritzen.
API Changes That May Require Code Updates
- ShImage::loadPNG(filename) moved out of ShImage into ShUtil::load_PNG(image, filename), shifting the libpng dependency to ShUtil rather than the core.
- The parameters of atan2() were reversed to match the C++ and Python order.
- smoothstep() now uses cubic interpolation; the previous smoothstep behavior is now called linstep().
- All iterators in ShProgram and ShProgramNode were renamed to match the book, e.g. uniforms_begin() became begin_parameters() and inputs_end() became end_inputs().
Bug Fixes
This release also resolves several defects, including sign() on arb, mipmap level rebuilding, and do..until loops in arb fragment programs.
Remaining Known Issues
- Build problems on 64-bit machines.
- Build problems on OS X.
- Not all unit tests pass on ATI cards.
- Texture filtering on the cc backend (the tex unit testing will fail).
The first three issues will be addressed before 0.8.0. If you depend on the last one, please reach out, as it is not planned for this release.
Learn More and Get Involved
For details on Sh and how to install and build it, visit the Sh Wiki main page. You can also use the libsh-users mailing list to ask questions and read what other users say about Sh.
Posted by Francois on 16:59, 9 November 2005 (EST).

Change Log
2005-11-08
Francois Marier <[email protected]>: In src/ShBaseTextureImpl.hpp and ShBaseTexture.hpp, operator() and operator[] now return ShTexData objects. This extra level of indirection enables immediate mode texture assignments later.
2005-11-06
Andrew Lauritzen <[email protected]>: Several optimizations to uniform update in backends/gl/, specifically in GLSL. In backends/gl/GlslCode.cpp, uniform update now correctly handles non-"float" floating point types (like double and half) and non-"int" integer types. In src/ShContext.*, a few things were moved to inline functions for performance.
2005-11-04
Francois Marier: In backends/gl/ArbCode.cpp (genStructNode), the node that continue jumps to is tracked so the if block closes at the right time. The same tracking was added in backends/gl/GlslCode.cpp (gen_structural_node).
2005-11-03
Francois Marier: In src/ShStructural.cpp (ShStructural), PROPINT nodes (multi-exit loops) are detected and created, and bugs in removing duplicate successors and predecessors were fixed. The PROPINT type was added to src/ShStructural.hpp. Code generation for PROPINT nodes was added in backends/gl/GlslCode.cpp (gen_structural_node) and backends/gl/ArbCode.cpp (genStructNode). The 'if' and 'break' statements were refactored into push_if() and push_break(), and the invert member in 'if' instructions is now handled. push_break() and push_if() were added to backends/gl/ArbCode.hpp.
2005-10-31
Andrew Lauritzen: In backends/gl/ArbCode.cpp (updateUniforms), the code was optimized to be more efficient, especially with normal (<= 4 component) float uniforms.
2005-10-24
Francois Marier: In src/ShSyntax.hpp (SH_UNTIL), the condition is negated since the loop becomes a do..while loop in immediate mode. In src/ShParser.cpp (parseDo), an extra node was added between the body and the condition evaluation so SH_CONTINUE can jump there and re-evaluate the condition instead of jumping back to the start of the body.
2005-10-21
Francois Marier: In backends/gl/ArbCode.cpp (allocTemps), the write mapping and read check were reordered in the register allocator to fix a problem where a variable written to in the scope would not be reused later in the same scope.
2005-10-20
Francois Marier: A boolean parameter was added to both shBreak() and shContinue() in src/ShSyntax.cpp and ShSyntax.hpp. In src/ShParser.cpp and ShParser.hpp, a stack tracks the break and continue points for each scope, and parse_break() and parse_continue() generate the right control flow graphs when using SH_BREAK and SH_CONTINUE. ShParser was turned into a singleton in src/ShParser.hpp and src/ShCtrlGraph.cpp.
2005-10-19
Francois Marier: In src/ShProgramNode.cpp (compile), the check for stream programs was removed because on some backends (e.g. cc) it makes sense to compile a stream program. In backends/gl/GlBackend.cpp (generate_code), code generation for stream programs is prevented and a warning is displayed.
2005-10-17
Stefanus Du Toit <[email protected]>: In src/ShDllExport.hpp, SH_DLLEXPORT is no longer defined if it already is, which fixes the build on win32.
2005-10-14
Francois Marier: In src/ShDllExport.hpp, the SH_DLLEXPORT macro was defined for the gcc visibility feature, and a new SH_DLLLOCAL macro was defined for explicitly hiding functions and methods. In backends/gl/ArbCode.cpp (ArbCode), an error is thrown when creating an ArbCode object with a unit type other than vertex or fragment. In src/ShProgramNode.cpp (compile), compilations of stream programs are ignored with a warning. In src/ShSyntax.cpp (shCompile), duplicated code was moved into a single generic function.
2005-10-07
Francois Marier: In backends/gl/GlslCode.cpp and GlslCode.hpp, bind_generic_attributes() was added to be called before linking the glsl program; it binds all attributes to the index they were assigned earlier. In generate(), the original variables are passed to the variable map so it can edit the user-facing metadata. In backends/gl/GlslSet.cpp, all generic vertex attributes are bound when a vertex shader is bound. In backends/gl/GlslVariable.hpp and GlslVariable.cpp, the m_attribute member variable now tracks the index where vertex attributes are located. In backends/gl/GlslVariableMap.cpp, allocate_generic_vertex_inputs() was refactored to use the new allocate_generic_vertex_input() method, which assigns an index to the variable and changes its user-facing metadata; m_original_vars was added to the constructor and destructor. In backends/gl/GlslVariableMap.hpp, the allocate_generic_vertex_input() method was added, and a copy of the original variables is kept to change their metadata.
2005-10-06
Francois Marier: In backends/gl/GlslCode.hpp, GlslCode.cpp, GlslVariableMap.cpp and GlslVariableMap.hpp, the original Sh name is printed when declaring variables. In backends/gl/ArbCode.cpp, an error message is printed when an input cannot be bound to any built-in variables (semantic binding).
2005-09-30
Francois Marier: Changes to src/ShProgramNode.
Page Tools
Explore related wiki actions and resources:
