[Unity SRP] How do I clear 3d RW RenderTexture?

I’m trying to port my real-time GPU voxelization from standalone DirectX11 application into Unity SRP. The approach I’m using is basically this The Basics of GPU Voxelization | NVIDIA Developer

I’m using ReadWrite 3d RenderTexture to write voxel data in pixel shader.

Everything is working fine except I have no idea how to clear my RenderTexture every frame before doing the voxelization pass.

I could not find any appropriate clear function, so I've tried iterating over all the layers, binding them as render targets and clearing:
    for (int i = 0; i < voxelSpaceDimensions.z; i++) {
        CoreUtils.SetRenderTarget(
            voxelizationBuffer, // <- Command buffer.
            voxelSpace.colorBuffer, // <- RW 3d RenderTexture.
            ClearFlag.Color,
            Color.clear,
            0, // <- Miplevel.
            CubemapFace.Unknown,
            i // <- 3d RenderTexture Layer.
        );
    }

Frame debug shows everything as expected, but in reality the texture has not been cleared.

Well, as it always happens, as soon as I posted this question I tinkered a bit more with the code and found a solution.

As stated here some platforms let you bind entire 3d render texture at once (SetRenderTarget with depthSlice = -1).

So I got rid of the loop, put -1 as depthSlice parameter and everything worked:

    CoreUtils.SetRenderTarget(
        voxelizationBuffer,
        voxelSpace,
        ClearFlag.Color, Color.clear,
        0, CubemapFace.Unknown, -1
    );

    // Don't forget to change the render target back.
    CoreUtils.SetRenderTarget(
        voxelizationBuffer,
        BuiltinRenderTextureType.CameraTarget
    );