I tried the codes below

RWTexture2D<uint> OutDBuffer32;
RWTexture2D<uint> OutVBuffer32;
.
.
.
void WritePixel(...)
{
.
.
.
uint OldDepthValue = 0;
InterlockedMax(OutDBuffer[PixelPos], DepthInt, OldDepthValue);
if(OldDepthValue < DepthInt)
{
OutVBuffer[PixelPos] = PixelValue;
}
}

Still have the problems. Some pixels are flikering.