issues with shader generator and python ? ubuntu 16.04

I wanted to play with the shader generator but I run into some issues.

i enable it using the self.render.setShaderAuto() call but then:

  1. On latest master (c3a1968), rendering with the shader generator segfaults.
    (simple scene with 3 directional lights and a single rather small mesh).
    Couldn’t really figure it out yet why, but if I revert back to v1.9.3 branch and built, it works.

  2. On the v1.9.3 branch (where it doesn’t segfaults), the setShaderInput doesn’t seem to be respected

If I try to modify the shader generator code and for instance add and use an additional param “myparam” in the fragment shader, panda fails with the following expection:

Assertion failed: Shader input myparam is not present.
at line 414 of panda/src/pgraph/shaderAttrib.cxx
:display:gsg:glgsg(error): panda/src/glstuff/glCgShaderContext_src.cxx, line 135: Invalid program handle.

it doesn’t matter how i use the self.render.setShaderInput(“myparam”, LVector4i(1,2,3,4))
(before or after the setShaderAuto() call) panda always fails.

I added the following debugging to the
const Shader::ShaderPtrData *ShaderAttrib::get_shader_input_ptr(const InternalName *id) const
definition:

for (Inputs::const_iterator l = _inputs.begin(); l != _inputs.end(); l++)
std::cout << l->second->get_name()->get_name() << std::endl;

and discovered that the only inputs set are those related to the lights in the scene:
alight0
dlight0
dlight1
dlight2

are the custom shader inputs for some reason ignored when the shader generator is on ?
am I missing something ?
I’d appreciate any help or pointers

The ShaderGenerator creates its own ShaderAttrib containing the shader and any shader inputs that it needs in the ShaderGenerator::create_shader_attrib method. It will override any shader inputs already set on the node.