0.8.0rc0 Release Notes
From ShWiki
Codename: Andechs
This is the first release candidate for the upcoming Sh 0.8. The goal of the 0.8 release is to be feature-complete and to commit to a stable ABI.
We would like to see as many people as possible test this release in order to provide as stable a 0.8.0 release as we can. Once 0.8.0 has been released future 0.8.x versions of Sh will retain API/ABI compatibility and a new development branch, 0.9.x will begin for changes which break the API/ABI.
New features include:
- support for generic input binding on the arb and glsl backends
- support for the ATI draw buffers extension on the glsl backend (it was already available on arb)
- nibbles for all library functions
- new iterators in ShProgram to walk through all uniforms (including recursively dependent ones): begin_all_parameters() and end_all_parameters()
Three new control flow statements have been added: SH_RETURN, SH_BREAK and SH_CONTINUE. Also, there is a number of new library functions:
- atan()
- bezier()
- ShProgram::describe_bindings()
- bernstein<N>() -- dummy function for N != 4
- hermite() -- dummy function
- noise, linnoise, slinnnoise, snoise -- dummy functions
- texhash -- dummy function
(Our plan is to finish implementing the dummy functions in point releases after 0.8.0 is out.)
We are also happy to release several optimizations to the uniform update methods (arb and glsl backends) thanks to Andrew Lauritzen.
Some changes may require users to modify their code as the API was changed slightly:
- ShImage::loadPNG(filename) has moved out of ShImage to ShUtil::load_PNG(image, filename) in order to move the libpng dependency to ShUtil instead of the core.
- Reversed the parameters of atan2() to match C++ and Python order.
- smoothstep() now uses cubic interpolation. The old smoothstep function is now called linstep().
- renamed all iterators in ShProgram and ShProgramNode to match the book. For example, uniforms_begin() has become begin_parameters() and inputs_end() has become end_inputs().
Finally, this release addresses several bugs including sign() on arb, mipmap levels rebuilding and do..until loops in arb fragment programs.
Remaining known issues:
- build problems with 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 will be fixed before 0.8.0 but if you depend on the last one, please get in touch with us as it is not planned for this release.
For more information on Sh and how to install and build it, visit the Sh Wiki.
Of course, you can always use the libsh-users mailing list to ask questions and read what other users have to say about Sh.
--Francois 16:59, 9 November 2005 (EST)
Changes
2005-11-08 Francois Marier <francois@serioushack.com>
* src/ShBaseTextureImpl.hpp, ShBaseTexture.hpp: operator() and
operator[] now return ShTexData objects. This adds a level of
indirection which will allow for immediate mode texture
assignments later.
2005-11-06 Andrew Lauritzen <atlaurit@student.cs.uwaterloo.ca>
* backends/gl/: Several optimizations to uniform update,
specifically in GLSL.
* backends/gl/GlslCode.cpp: Uniform update now correctly
handles non-"float" floating point types (like double and half)
and non-"int" integer types.
* src/ShContext.*: Moved a few things to inline functions for
performance reasons.
2005-11-04 Francois Marier <francois@serioushack.com>
* backends/gl/ArbCode.cpp (genStructNode): Keep track of the node
that continue jumps to in order to close the if block at the right
time.
* backends/gl/GlslCode.cpp (gen_structural_node): Keep track of
the node that continue jumps to in order to close the if block at
the right time.
2005-11-03 Francois Marier <francois@serioushack.com>
* src/ShStructural.cpp (ShStructural): Detect and create PROPINT
nodes (multi-exit loops).
Fix bugs in removing duplicate successors and predescessors.
* src/ShStructural.hpp: Add the PROPINT type.
* backends/gl/GlslCode.cpp (gen_structural_node): Generate code
for PROPINT nodes.
* backends/gl/ArbCode.cpp (genStructNode): Generate code for
PROPINT nodes.
Refactor 'if' and 'break' statements into push_if() and
push_break().
Handle the invert member in 'if' instructions.
* backends/gl/ArbCode.hpp: Add push_break() and push_if().
2005-10-31 Andrew Lauritzen <atlaurit@student.cs.uwaterloo.ca>
* backends/gl/ArbCode.cpp (updateUniforms): Optimized to be
more efficient, especially with normal (<= 4 component) float
uniforms.
2005-10-24 Francois Marier <francois@serioushack.com>
* src/ShSyntax.hpp (SH_UNTIL): The condition should be negated
since the loop becomes a do..while loop in immediate mode.
* src/ShParser.cpp (parseDo): Add an extra node between the body
and the condition evaluation so that SH_CONTINUE can jump there
and evaluate the condition again instead of jumping back to the
start of the body.
2005-10-21 Francois Marier <francois@serioushack.com>
* backends/gl/ArbCode.cpp (allocTemps): Reorder the write mapping
and the read check in the register allocator to fix a problem
where a variable that has been written to in the scope will not be
reused later on in the same scope.
2005-10-20 Francois Marier <francois@serioushack.com>
* src/ShSyntax.cpp, ShSyntax.hpp: Add a boolean parameter to both
shBreak() and shContinue().
* src/ShParser.cpp, ShParser.hpp: Add a stack which keeps track of
the break and continue points for each scope.
Add parse_break() and parse_continue() to generate the right
control flow graphs when using SH_BREAK and SH_CONTINUE.
* src/ShParser.hpp, ShCtrlGraph.cpp: Turn ShParser into a
singleton.
2005-10-19 Francois Marier <francois@serioushack.com>
* src/ShProgramNode.cpp (compile): Remove the check for stream
programs because on some backends (e.g. cc) it makes sense to
compile a stream program.
* backends/gl/GlBackend.cpp (generate_code): Prevent code
generation for stream programs and display a warning.
2005-10-17 Stefanus Du Toit <sdt@serioushack.com>
* src/ShDllExport.hpp: Don't define SH_DLLEXPORT if it already
is. Fixes the build on win32.
2005-10-14 Francois Marier <francois@serioushack.com>
* src/ShDllExport.hpp: Define the SH_DLLEXPORT macro for the gcc
visibility feature. Define a new SH_DLLLOCAL macro to be used for
explicitely hiding functions and methods.
* backends/gl/ArbCode.cpp (ArbCode): Throw an error when creating
an ArbCode object with an unit type other than vertex or fragment.
* src/ShProgramNode.cpp (compile): Ignore compilations of stream
programs and output a warning.
* src/ShSyntax.cpp (shCompile): Move duplicated code into a single
generic function.
2005-10-07 Francois Marier <francois@serioushack.com>
* backends/gl/GlslCode.cpp, GlslCode.hpp
(bind_generic_attributes): Add this method to be called before
linking the glsl program. It binds all attributes to the index
they were assigned to earlier.
(generate): Pass the original variables to the variable map so
that it can edit the user-facing metadata.
* backends/gl/GlslSet.cpp: Bind all generic vertex attributes when
a vertex shader is bound.
* backends/gl/GlslVariable.hpp, GlslVariable.cpp: The m_attribute
member variable now keeps track of the index where vertex
attributes are located.
* backends/gl/GlslVariableMap.cpp: Refactor
allocate_generic_vertex_inputs() to use the new
allocate_generic_vertex_input() method which assign an index to
the variable and change its user-facing metadata.
Add m_original_vars to constructor and destructor.
* backends/gl/GlslVariableMap.hpp: Add the
allocate_generic_vertex_input() method.
Keep a copy of the original variables to change their metadata.
2005-10-06 Francois Marier <francois@serioushack.com>
* backends/gl/GlslCode.hpp, GlslCode.cpp, GlslVariableMap.cpp,
GlslVariableMap.hpp: Print the original Sh name when declaring
variables.
* backends/gl/ArbCode.cpp: Print an error message when an input
cannot be bound to any built-in variables (semantic binding).
2005-09-30 Francois Marier <francois@serioushack.com>
* src/ShProgramNode.hpp, ShProgramNode.cpp, ShProgram.hpp,
ShVariableNode.cpp, backends/gl/Utils.cpp, GlslVariableMap.cpp,
PBufferStreams.cpp, GlslCode.cpp, ArbCode.cpp, backends/cc/Cc.cpp:
Renamed the iterators according to the names used in the book.
* util/ShPngImage.hpp, ShPngImageImpl.hpp, ShPngImage.cpp: Move
all libpng code to a cpp file so that nobody but Sh will need to
include the libpng and zlib headers.
* src/ShProgramNode.cpp, ShProgramNode.hpp
(collect_dependent_uniform): Add this method to support the
collection of dependent uniforms' dependent uniforms.
(collectNodeDecls, collectVar, collectNodeVars): Rename some
private methods to match new coding standards
2005-09-29 Francois Marier <francois@serioushack.com>
* src/ShProgramNode.hpp, ShProgramNode.cpp, ShProgram.hpp: Add
all_uniforms_begin() and all_uniforms_end() to return all
uniforms, including recursively dependent ones.
* src/ShProgramNode.cpp (describe_interface): Display all uniforms
instead of just iterating through uniforms_begin().
2005-09-27 Francois Marier <francois@serioushack.com>
* util/ShPngImage.hpp, ShPngImageImpl.hpp, shutil.hpp,
src/ShImage.hpp, src/ShImageImpl.hpp, src/ShImage.cpp: Move the
PNG stuff to util. Make load_PNG, save_PNG and save_PNG16 free
functions instead of ShImage methods.
2005-09-23 Francois Marier <francois@serioushack.com>
* src/ShSyntax.hpp: Add the namespace qualifier to ShContext so
that it's not necessary to be using the SH namespace before using
SH_IF or any other control flow macro.
* backends/gl/GlslVariable.cpp, GlslVariable.hpp (attribute): Add
this method to set the name of the variable and make it an
attribute (with the new m_attribute bool).
* backends/gl/GlslVariableMap.cpp, GlslVariableMap.hpp
(allocate_generic_vertex_inputs): Add this method and call it
instead of allocate_builtin_inputs() when the "opengl:matching"
meta tag is set to "generic". It uses the attribute facility in
Glsl instead of using the built-in attribute names (like
gl_Position).
(attribute_begin, attribute_end): Add these methods to allow the
code generation to declare attributes at the top of the code.
* backends/gl/GlslCode.cpp (print): Declare attributes at the top
of the source file.
* backends/gl/GlslVariableMap.cpp (GlslVariableMap),
ArbCode.cpp (ArbCode): Remove the hard-coded number of maximum
draw buffers and get it through OpenGL's glGet instead.
2005-09-22 Francois Marier <francois@serioushack.com>
* backends/gl/PBufferStreams.cpp (execute): Only display the
warning about intermediate streams once per process.
* backends/gl/ArbCode.cpp, GlslCode.cpp (genStructNode): Don't
check for the size of the successor in IF blocks, it prevents
perfectly valid code (e.g. nested IFs inside another IF) from
being generated.
2005-09-21 Francois Marier <francois@serioushack.com>
* src/ShLibClampImpl.hpp, ShLibClamp.hpp: Rename smoothstep() to
linstep() and cubicstep() to smoothstep(). This is done to be
consistent with RenderMan.
2005-09-16 Francois Marier <francois@serioushack.com>
* backends/gl/GlslEmit.cpp (emit_discard): Implement SH_OP_RET.
* backends/gl/GlslCode.hpp (emit_discard): Add a string parameter
to select the function to call.
* src/ShSyntax.cpp: Add the SH_RETURN statement.
* src/ShTypeConvertTransformer.cpp: Add SH_OP_RET to the switch
statement.
* src/ShTextureNode.cpp (build_mipmaps): Add a check to avoid
building the mipmaps when the texture is set to a specific texid.
2005-09-15 Francois Marier <francois@serioushack.com>
* src/ShNibblesImpl.hpp, ShNibbles.hpp: Add a nibbles for bezier
and hermite.
* src/ShLibSplines.hpp, ShLibSplinesImpl.hpp: Move bezier to the
core and fix it so that it actually compiles.
Add a dummy function for hermite.
* util/ShFunc.hpp, ShFuncImpl.hpp: Remove bezier from util.
Remove broken hashlcg() function.
* src/ShLibClampImpl.hpp, ShLibClamp.hpp (cubicstep): Add
cubicstep to the core.
* util/ShFuncImpl.hpp, ShFunc.hpp (deprecated_smoothstep): Remove
this function since it's been renamed and moved to the core.
2005-09-14 Francois Marier <francois@serioushack.com>
* src/ShConcreteCTypeOp.cpp, ShConcreteRegularOpImpl.hpp,
ShTranformer.cpp, backend/cc/CcEmit.cpp: Reverse the parameters of
atan2().
* src/ShLibSplinesImpl.hpp, ShLibSplines.hpp (bernstein): Add this
function to the core. This is a dummy function for anything other
than N=4.
* src/ShNibblesImpl.hpp, ShNibbles.hpp (shBernstein): Add this
nibble.
* src/ShLib.hpp: Include the splines functions header.
* util/ShFuncImpl.hpp: Remove the old version of
bernstein_basis_4.
2005-09-09 Francois Marier <francois@serioushack.com>
* src/ShImage.hpp, ShImageImpl.hpp, ShImage.cpp,
examples/textures/main.cpp: Rename loadPng, savePng, savePng16,
load_png and save_png to load_PNG, save_PNG and save_PNG16.
2005-09-07 Francois Marier <francois@serioushack.com>
* src/ShNibblesImpl.hpp, ShNibbles.hpp: Add nibbles for discard()
and groupsort<S>().
2005-08-30 Stefanus Du Toit <sdt@serioushack.com>
* src/FixedManipulator.cpp (operator&): Allow empty manipulators.
Might need to be done elsewhere also.
* backends/gl/ArbCode.cpp: Do not use the same destination register
when updating conditional registers on NV. Fixes branches based on
uniforms, which cannot be assigned to.
* src/ShNibblesImpl.hpp: Remove extra default parameters in
function definitions. Fixes build with MSVC7.
2005-08-26 Francois Marier <francois@serioushack.com>
* src/ShNibblesImpl.hpp, ShNibbles.hpp: Added nibbles for
faceforward, lit, reflect, refract, sat, ceil, floor, round, sign,
sort, not, and, or, any, all, max1, min1, clamp, cond, smoothstep,
smoothpulse and join.
Fixed the nibbles for prod, sum and mad.
* src/ShLibClampImpl.hpp (smoothpulse): Changed sstep() calls to
use smoothstep().
* src/ShProgramNode.hpp, ShProgram.hpp (backend_name): Add this
method to retrieve the backend name on which the program is
currently compiled.
* src/ShProgramNode.cpp (compile): Set the backend name when
compiling the program.
(ShProgramNode): Initialize the backend name to "".
2005-08-25 Francois Marier <francois@serioushack.com>
* backends/gl/ArbReg.cpp, ArbReg.hpp (binding_name): Add this
method to return the actual name of the Arb variable.
* backends/gl/ArbCode.cpp (describe_bindings): Implementation of
describe_bindings() in the Arb backend.
* backends/gl/GlslCode.cpp (describe_bindings): Implementation of
describe_bindings() in the Glsl backend.
* src/ShProgramNode.cpp (describe_bindings): Add a little header
before outputing the backend information.
2005-08-24 Francois Marier <francois@serioushack.com>
* backends/gl/GlslVariable.cpp, GlslVariable.hpp: Add the draw
buffer variable (gl_FragData[]) to the built-in output variables.
* backends/gl/GlslVariableMap.cpp (GlslVariableMap): Enable the
the draw buffers extension if it's available.
* backends/gl/ArbCode.cpp (ArbCode): The ATI_draw_buffers
extension is also known as ARB_draw_buffers so check for both.
* backends/gl/GlslEmit.cpp, GlslCode (emit_exp10): Replace the
call to pow by a multiplication.
(emit_log10): Replace the division by a multiplication.
(emit_log, emit_exp): Remove these functions and use the built-in
exp and log functions instead.
* backends/gl/GlslEmit.cpp (table_substitution): Remove
unnecessary casts when the destination variable is the same size
as the source (in the case of assignments) or the result of the
function call.
* backends/gl/PBufferStreams.cpp: Use the target of the stream
program to come out with the proper target for vertex and fragment
programs (e.g. if the stream program's target is "glsl:stream"
then the other targets should be "glsl:vertex" and "glsl:fragment")
* src/ShProgramNode.cpp, ShProgramNode.hpp, ShProgram.hpp
(describe_bindings): Add the two versions of describe_bindings().
They call the backend functions and return the backend-specific
binding info.
* src/ShBackend.hpp (describe_bindings): Add this new pure virtual
method.
* backends/gl/GlslCode.cpp, GlslCode.hpp, ArbCode.cpp,
ArbCode.hpp, backends/cc/Cc.cpp, Cc.hpp (describe_bindings): Add
empty implementations of describe_bindings() for all three
backends.
2005-08-23 Francois Marier <francois@serioushack.com>
* backends/cc/Cc.cpp (generate): On OSX, define exp10() in the
prologue of generated programs.
* src/ShMath.hpp: Add exp10() on OSX.
* src/ShBackend.cpp, ShBackend.hpp (derived_targets): Go through
all installed backends when making a list of derived targets.
(check_target): Add this method.
(target_handler): Move the backend loading to load_backends().
* src/ShGeneric.hpp: Add typedefs like the ones availabled in
ShAttrib (e.g. ShGeneric2f, ShGeneric4fub, etc.).
* src/ShImage.hpp: Make ShPngImage a DLL-exported class.
2005-08-22 Francois Marier <francois@serioushack.com>
* src/ShImage.hpp, ShImageImpl.hpp, ShImage.cpp: Move all libpng
code into a non-templated class to reduce the libpng dependency.
Remove the DLL_EXPORT tag so that it compiles on Windows.
* src/ShImageImpl.hpp, ShImage.hpp: Rename ShImageNode to
ShTypedImage.
2005-08-19 Francois Marier <francois@serioushack.com>
* src/ShMemory.cpp (ShHostHostTransfer::transfer): Only check that
sizes match when the types are the same.
* src/ShTextureNode.cpp (build_mipmaps): Make a float copy of the
base storage so that mipmaps can be built from a non-float
texture.
* src/ShImage.hpp, ShImageImpl.hpp, ShImage.cpp: Rename ShImage
into ShImageNode and template it so that fub images can be created
fron PNG files for example. Make ShImage a typedef of
ShImageNode<float> for backwards compatibility.
2005-08-17 Francois Marier <francois@serioushack.com>
* src/ShTransformer.cpp (struct ATan2ExpanderBase): Fix issues
related to negative values and zeroes in atan2().
2005-08-17 Andrew Lauritzen <atlaurit@student.cs.uwaterloo.ca>
* src/ShBaseTexture.hpp: Added a method to access the node that a
texture refers to.
2005-08-16 Francois Marier <francois@serioushack.com>
* src/ShTextureNode.cpp (memory): Must reinitialize memories
whenever the base level is modified.
* src/ShTextureNode.hpp, ShTextureNode.cpp (build_mipmaps): Add
some checks to skip rebuilding the mipmaps when it's not necessary
and return a boolean to indicate whether they were rebuilt or
not.
* backends/gl/GlTextures.cpp (bindTexture): Always call
build_mipmaps() since it includes the necessary checks now.
2005-08-15 Francois Marier <francois@serioushack.com>
* backends/gl/GlslCode.hpp, GlslCode.cpp (resolve): Cast the
argument to the proper size if necessary.
* backends/gl/GlslEmit.cpp (table_substitution): Make use of the
new resolve method to avoid casting arguments unnecessarily.
* backends/gl/GlslEmit.cpp, GlslCode.hpp (emit_pow): Add this
method to emit pow operations and properly cast both the result
and the arguments.
* backends/gl/GlslEmit.cpp (emit_exp, emit_cbrt, emit_hyperbolic):
Make use of emit_pow to do the necessary casts.
* src/ShTextureNode.cpp (initialize_memories): Make sure the
mipmap levels are always >= 1.
2005-08-12 Francois Marier <francois@serioushack.com>
* src/ShBackend.cpp: Changed some more iterators to be 64-bit
safe.
2005-08-11 Francois Marier <francois@serioushack.com>
* backends/gl/GlslEmit.cpp (GlslOpCodeVecs),
backends/cc/CcEmit.cpp (CcOpCodeVecs),
src/ShBackend.cpp (load_libraries):
Change size of iterators to be size_t so that it works on 64-bit
machines.
2005-08-11 Andrew Lauritzen <atlaurit@student.cs.uwaterloo.ca>
* src/ShNibblesImpl.hpp: Fixed a minor compilation error on
windows to do with redefinition of default parameters.
* src/ShRecord.cpp: Removed some unnecessary debug spew.
2005-08-10 Francois Marier <francois@serioushack.com>
* src/ShNibblesImpl.hpp, ShNibbles.hpp: Add nibbles for gradient,
cellnoise, scellnoise, hash, texhash, linnoise, slinnoise, noise,
snoise, perlin, sperlin, turbulence, sturbulence, poly, cross,
length, length_1, length_inf, distance, distance_1, distance_inf.
2005-08-09 Francois Marier <francois@serioushack.com>
* backends/gl/GlTextures.cpp (shGlInternalFormat): Add a warning
about the lack of float textures. Fallback on byte textures.
2005-08-08 Francois Marier <francois@serioushack.com>
* src/ShNibblesImpl.hpp, ShNibbles.hpp: Add nibbles for exp,
expm1, exp2, exp10, log, logp1, log2, log10, cbrt, rsqrt prod,
sum, rcp, atan2, atan, mad, sinh, cosh, tan, tanh, asinh, acosh,
atanh, dx, dy and fwidth.
Add macros for ternary operations.
2005-08-04 Francois Marier <francois@serioushack.com>
* backends/gl/ArbEmit.cpp (emit_sgn): Optimized the sign operation
on Arb by removing one addition (Will's idea).
* src/ShNibblesImpl.hpp, ShNibbles.hpp: Rename the nibbles so that
they match the book.
2005-08-03 Francois Marier <francois@serioushack.com>
* backends/gl/ArbEmit.cpp (emit_sgn): Fix the sign(0) case without
using DIV or COND.
* backends/gl/ArbEmit.cpp, ArbCode.hpp (emit_atan): Implement ATAN.
2005-08-02 Francois Marier <francois@serioushack.com>
* src/ShLibMiscImpl.hpp (cast): Make sure all components are
initialized to zero to avoid problems in some environments.
