errors below, not sure if it's worth sorting through. I imagine the main culprit is the "no available implicit conversion" error.
if i understand correctly the problem, you want to pass the depth texture from a group of objects in rendering another object, but both objects are in the same node.
i guess my suggestion is to bind the "renders-depth" objects and the "needs-depth" objects to separate nodes.
node A (@layer 1) draws the "renders-depth" objects and outputs the depth texture.
node B (@layer 2) draws "needs-depth" with the depth values from node A.
AFAIK, that should work without a delayed frame. the layer attribute will ensure that A draws first, and that B's depth texture is up to date.
jit.gl.shader: -- START GLSL INFO LOG: vp --
ERROR: 0:13: Left-hand-side of assignment must not be read-only
jit.gl.shader: -- END GLSL INFO LOG: vp --
jit.gl.shader: GLSL program failed to compile.
jit.gl.shader: -- START GLSL INFO LOG: fp --
ERROR: 0:85: Incompatible types in initialization (and no available implicit conversion)
ERROR: 0:88: Use of undeclared identifier 'intersect'
ERROR: 0:94: Incompatible types in initialization (and no available implicit conversion)
ERROR: 0:96: Incompatible types in initialization (and no available implicit conversion)
ERROR: 0:101: Use of undeclared identifier 'lightDir'
ERROR: 0:104: Use of undeclared identifier 'intensity'
ERROR: 0:106: Use of undeclared identifier 'lightDir'
ERROR: 0:106: Use of undeclared identifier 'eye'
ERROR: 0:108: Use of undeclared identifier 'h'
ERROR: 0:109: Use of undeclared identifier 'intSpec'
ERROR: 0:112: Use of undeclared identifier 'intensity'
ERROR: 0:114: Use of undeclared identifier 'lightColor'
ERROR: 0:114: Use of undeclared identifier 'intersect'
ERROR: 0:116: Use of undeclared identifier 'niceColor'
jit.gl.shader: -- END GLSL INFO LOG: fp --
jit.gl.shader: GLSL program failed to compile.
jit.gl.shader: -- START GLSL INFO LOG: fp --
ERROR: 0:80: Incompatible types in initialization (and no available implicit conversion)
ERROR: 0:82: Incompatible types in initialization (and no available implicit conversion)
ERROR: 0:87: Use of undeclared identifier 'lightDir'
ERROR: 0:90: Use of undeclared identifier 'intensity'
ERROR: 0:92: Use of undeclared identifier 'lightDir'
ERROR: 0:92: Use of undeclared identifier 'eye'
ERROR: 0:94: Use of undeclared identifier 'h'
ERROR: 0:95: Use of undeclared identifier 'intSpec'
ERROR: 0:98: Use of undeclared identifier 'intensity'
jit.gl.shader: -- END GLSL INFO LOG: fp --
jit.gl.shader: GLSL program failed to compile.
jit.gl.gridshape: -- START GLSL INFO LOG: fp --
ERROR: 0:80: Incompatible types in initialization (and no available implicit conversion)
ERROR: 0:82: Incompatible types in initialization (and no available implicit conversion)
ERROR: 0:87: Use of undeclared identifier 'lightDir'
ERROR: 0:90: Use of undeclared identifier 'intensity'
ERROR: 0:92: Use of undeclared identifier 'lightDir'
ERROR: 0:92: Use of undeclared identifier 'eye'
ERROR: 0:94: Use of undeclared identifier 'h'
ERROR: 0:95: Use of undeclared identifier 'intSpec'
ERROR: 0:98: Use of undeclared identifier 'intensity'
jit.gl.gridshape: -- END GLSL INFO LOG: fp --
jit.gl.gridshape: jit.gl.shader: GLSL program failed to compile.
jit.gl.gridshape: -- START GLSL INFO LOG: fp --
ERROR: 0:85: Incompatible types in initialization (and no available implicit conversion)
ERROR: 0:88: Use of undeclared identifier 'intersect'
ERROR: 0:94: Incompatible types in initialization (and no available implicit conversion)
ERROR: 0:96: Incompatible types in initialization (and no available implicit conversion)
ERROR: 0:101: Use of undeclared identifier 'lightDir'
ERROR: 0:104: Use of undeclared identifier 'intensity'
ERROR: 0:106: Use of undeclared identifier 'lightDir'
ERROR: 0:106: Use of undeclared identifier 'eye'
ERROR: 0:108: Use of undeclared identifier 'h'
ERROR: 0:109: Use of undeclared identifier 'intSpec'
ERROR: 0:112: Use of undeclared identifier 'intensity'
ERROR: 0:114: Use of undeclared identifier 'lightColor'
ERROR: 0:114: Use of undeclared identifier 'intersect'
ERROR: 0:116: Use of undeclared identifier 'niceColor'
jit.gl.gridshape: -- END GLSL INFO LOG: fp --
jit.gl.gridshape: jit.gl.shader: GLSL program failed to compile.