i just use linear z in my application and it worked fine, but i have a question - is the z value from the projection matrix the 1/z?
I believe you are talking about software rasterizing while everyone else is talking about GPU's or how GPU transformation is abstracted with OpenGL/D3D. With software rasterizing you can of course do anything you like, e.g. use W-buffer which is linear. The actual z value written to the depth buffer is (a*z'+b)/(c*z'+d), where z' is the camera space z and a, b, c and d coefficients from the projection matrix (i.e. the coefficients of the bottom right 2x2 matrix of the projection matrix). As you can see, this isn't linear in relation to the z', except if c=0, which is orthogonal projection.