I read some of the posts regarding depth_stencil textures and found that it is just same as depth textures without shadow mapping (normal sampler2D) and no need to add any special code regarding stencil test though i tried with that too. I am using AMD catalyst on windows, i guess it might be buggy.