Hello,
Is it still impossible for the Metal fragment shader to write to the depth buffer for the current version of Metal on the M1 CPUs? The image below shows the use case for my MRIcroGL software (with these images showing the correct behavior of OpenGL on my M1). MRIcroGL is a volume raycaster. The vertex shader simply determines the location of the front faces of the cube (left panel). The fragment shader subsequently samples each pixel from the front face of the cube to the back face, accumulating color/opacity from all the voxels it traverses. In OpenGL, I can simply write 'gl_FragDepth' for a ray when it first hits a non-transparent voxel. This has two benefits: first the depth test fro the subsequent crosshairs correctly shows the ntersection with the brain, not the cube. Second, we can read the depth buffer allowing depth picking
, where clicking on the brain moves the crosshair to that location (allowing the user to work out the location of features seen on the rendering for 2D orthogonal slices).
In every other respect, my software works identically when compiled for OpenGL and Metal. However, the inability to write to a depth buffer seems like a deal breaker for this usage scenario.