7

Does Vulkan have support for saving the vertices output from a pipeline stage? I've been looking and I can't find any examples or references, maybe someone else knows otherwise?

Andrew Williamson
  • 8,299
  • 3
  • 34
  • 62

1 Answers1

5

Transform Feedback didn't make the cut for the initial Vulkan release, and there is no direct equivalent to it.

So you actually have to do it yourself by e.g. writing to a SSBO from a geometry shader using PrimitiveIDs or go with compute shaders.

Note that the geometry shader version might not work on all devices, as it requires support for the vertexPipelineStoresAndAtomics feature.

Update

Support for TransformFeedback has been made available as an extension since 1.1.88.

Andrew Williamson
  • 8,299
  • 3
  • 34
  • 62
Sascha Willems
  • 5,280
  • 1
  • 14
  • 21
  • Thanks. Do you think it will make it into Vulkan 1.1 (or whatever comes next)? – Andrew Williamson Jun 24 '16 at 11:09
  • 1
    It may be added at some point, though I don't know if it'll be in the next major Vulkan release. Afaik TF is not a highly requested feature and most use cases can be reproduced with compute shaders and SSBOs which are both mandatory in Vulkan. – Sascha Willems Jun 24 '16 at 11:16
  • I think TF is too high-level for Vulkan. Is there something to TF, that you can't really do in Vulkan explicitly and even more generaly? – krOoze Jun 24 '16 at 11:23
  • 3
    @krOoze: "*I think TF is too high-level for Vulkan.*" I thought the same thing, but I've reconsidered this standpoint. Mainly because of vertexPipelineStoresAndAtomics *not* being a required feature. ES 3.1 hardware is clearly capable of TF, but lots of ES 3.1 hardware can't do vertexPipelineStoresAndAtomics. So there is some legitimate justification for it. Oh, you *can* use a compute shader, but it's just as unnatural as using feedback to do arbitrary computations. Plus, you can't tessellate and use a compute shader. Nor can you choose to feedback what you're actually rendering. – Nicol Bolas Jun 24 '16 at 13:31
  • @NicolBolas AFAIK, OGL ES 3.1 has L/S and atomics too, so... they should just enable it in Vulkan? ; Well I would question by what sort of horrible hack TF would have to be implemented on HW without some sort of write capability. – krOoze Jun 25 '16 at 15:08
  • @krOoze: "*OGL ES 3.1 has L/S and atomics too*" Yes, but like desktop OpenGL, ES doesn't *guarantee* that you can use them in the vertex processing stage. The minimum requirements for the number of bound images in all vertex processing stages is 0, thus permitting implementations to support no vertex load/stores. The "horrible hack" of TF without load/store is simply having specialized hardware for a specific use case. Just like texture fetching and tessellation uses specialized hardware. It should also be noted that GL 3.x hardware had TF, but no generalized image load/store capabilities. – Nicol Bolas Jun 25 '16 at 15:18