I have a compute shader operating on my buffer in my QML (5.8) app, the problem is that I cannot seem to read this buffer, only write to it.

My buffer is a Qt3DRender::QBuffer, I set its contents with

Qt Code:
  1. Qt3DRender::QBuffer::setData(QByteArray::fromRawData(reinterpret_cast<const char*>(points_.linearize()), static_cast<int>(sizeof(PointType) * pc)));
To copy to clipboard, switch view to plain text mode 

where pc is the number of points.

To use it, I created a QGeometry which sets up QAttributes, and apply the computer shader as a material component to the Entity
My material:

Qt Code:
  1. Material {
  2. property PointBuffer dataBuffer;
  3.  
  4. ShaderProgram {
  5. id: computeShader
  6. computeShaderCode: loadSource("qrc:/shaders/pointcloud.comp")
  7. }
  8.  
  9. effect: Effect {
  10. techniques: [
  11. Technique {
  12. renderPasses: [
  13. RenderPass {
  14. shaderProgram: computeShader
  15. parameters: [
  16. // Point buffer
  17. Parameter { name: "Particles"; value: dataBuffer }
  18. ]
  19. }
  20. ] // renderpasses
  21. filterKeys: [
  22. FilterKey { name: "type"; value: "compute" }
  23. ]
  24. graphicsApiFilter {
  25. api: GraphicsApiFilter.OpenGL
  26. profile: GraphicsApiFilter.CoreProfile
  27. majorVersion: 4
  28. minorVersion: 3
  29. }
  30. } // technique
  31. ] // techniques
  32. }
  33. }
To copy to clipboard, switch view to plain text mode 

In my buffer code though, whenever I read from the buffer (Qt3DRender::buffer::data()), I only get the data I wrote to it, not the result of the compute shader.

I've tried setting the usage (http://doc.qt.io/qt-4.8/http://doc.qt.io/qt-5/qt3drender-qbuffer.html#UsageType-enum) to various things, but no dice.

In my OpenGL book, I see that one can [I]glMapBuffer[I] to have read/write access, and there's even a QOpenGLBuffer that has an ENUM to set the access in a similar way, but I can't seem to make use of either of these; i.e. I can't find a way to map my buffer, and the QOpenGLBuffer doesn't seem compatible with any of the renderers.

(Cross posted on forum.qt.io and SO)