1
$\begingroup$

In the usual pipeline (vertex, tessellation, geometry and fragment shaders) the geometry can be deformed and in the geometry shader it is possible to copy the generated and deformed geometry in order to transfer it from several positions into several layers of a texture to render. Also known as "layered rendering". Does the new mesh shading pipeline (task shader, mesh shader and fragment shader) also have the option of generating / deforming the mesh and then copying it into different layers? So that you can render the same scenario multiple times within one drawcall?

I am asking for Vulkan, OpenGL and DirectX 12

$\endgroup$
3
1
$\begingroup$

In accord with the GLSL extension, gl_Layer in a mesh shader is part of the predefined gl_MeshPerPrimitiveNV output interface block. It seems to have the expected definition. This is a per-primitive parameter, so you can set it to a different value for each primitive you output.

Basically, yes: layered rendering is available in task/mesh shaders. And since this extension specifies the SPIR-V decorator equivalent (ie: Layer), it seems clear it can be used in the Vulkan equivalent just as well.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.