Apply depth range test and use gstate.isClearModeDepthWriteEnabled()

It didn't break any games but it didn't help any games i tested so far .