This does not actually work: The context must not be shared between threads, but using the same context between different samples actually seems to prevent OSL from switching between shaders. The proper solution would be to ensure memory pooling works correctly.
This reverts commit 69f87e69258d6266dcb20f09f7e3d4021e663432.
Regular rendering now works tiled, and supports save buffers to save memory
during render and cache render results.
Brick texture node by Thomas.
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/Textures#Brick_Texture
Image texture Blended Box Mapping.
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/Textures#Image_Texturehttp://mango.blender.org/production/blended_box/
Various bug fixes by Sergey and Campbell.
* Fix for reading freed memory in some node setups.
* Fix incorrect memory read when synchronizing mesh motion.
* Fix crash appearing when direct light usage is different on different layers.
* Fix for vector pass gives wrong result in some circumstances.
* Fix for wrong resolution used for rendering Render Layer node.
* Option to cancel rendering when doing initial synchronization.
* No more texture limit when using CPU render.
* Many fixes for new tiled rendering.
Currently all shader functions check the OSL/SVM flag to dispatch to the appropriate backend. If this turns out to be a significant overhead (unlikely) this test should be moved out of the inner loop.
Fixes for API changes in OSL RendererServices:
* Added two new required get_matrix methods, from OSL RendererServices (otherwise the constructor fails). The two new matrix methods probably still need an implementation.
* Removed deprecated "get_pointcloud_attr_query" and "pointcloud". There are two new routines for pointclouds, function headers for those are there.
* Removed the (unused) PARTIO code parts from OSL. It was marked as not tested / not working, and due to the api changes here broken for sure. Code is still in svn history if needed.
* Location: Basically the same as the location from Object Info node for object instances on particles, but in principle there could be additional offsets for dupli objects, so included for completeness.
* Size: Single float scale of the particle. Also directly translates to object scale for current dupli objects, but handy to have as a single float to start with instead of a scale vector (currently not even exposed in Object Info).
* Rotation: This is a quaternion, which are not yet supported by Cycles nodes. The float4 is copied to internal Cycles data and stored in the particles texture data, but the node doesn't have a socket for it yet and the data is not yet written to the stack. Code is just commented out so could be enabled quickly if/when rotation support is added to cycles.
* Velocity: Linear velocity vector of particles.
* Angular Velocity: Angular velocity around principle axes.
The texture data is currently packed tightly into the particles texture, which saves a few bytes, but requires an additional texture lookup for some vector attributes which spread over two float4s. Could also add another float4 to particle size to avoid this.
the implementation was following my early commit for Math node
I haven't had a chance to run those through Brecht, but would like to do eventually. (they work fine though)
It was read of initialized memory around holdout_weight in cases when
holdout material is used. Seems that it should be assigned to result
of shader_holdout_eval here.
If Brecht could double check this it'll be great.
This could potentially fix#32224: Holdout Error with CUDA Cycles Render