Fix some bugs in material, depth range state

picked from master
1 file changed