Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

is it possible to read data from vertex shader?

I am trying to write a simple GPGPU benchmark. To load the data into vertex buffer array, do some computation in the vertex shader, and read the data back. Is it possible? I am planning to run this on SGX GPUs.
Is there any way to do that? I dont want it to go through the transformation, clipping, Tiling phases, and pixel processing. that incurs additional overhead, and changes my data.

can I read back the data and examine it in the CPU? is there anyway in opengl es?

I can do the computations in pixel shader aswell, by sending data through a texture and multiplying with some constants and writing it to another frame buffer. but how do I get it back? i dont really want to present it to the screen. is there anyway to do that? can somebody point me to some tutorials if available?

like image 988
sai pallavi Avatar asked Oct 01 '13 18:10

sai pallavi


1 Answers

Reading Vertex output: Look for Transform Feedback - But you will have to have OpenGL ES 3.0 to use this.

For ES2.0 I suggest using fragment shader and Render To Texture techniques. Here is some link with tutorial After rendering to texture you basically have to read pixels of the texture.

Nice tutorial on reading the data here

tutorial about feedback: http://open.gl/feedback

like image 196
fen Avatar answered Sep 23 '22 03:09

fen