BBBsmoke / angleproject

Automatically exported from code.google.com/p/angleproject
Other
0 stars 0 forks source link

Transform feedback counter not properly reset #898

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

A short example:
Create a transform feedback buffer;
Set the internal transform feedback counter to zero with glBindBufferRange;
Draw a primitive;
Set the counter back to zero with glBindBufferRange;
At this point ANGLE should reset the internal counter to zero for the next draw 
call.
Draw a primitive.
You should expect ANGLE to overwrite the first primitive with the second 
primitive inside the feedback buffer.

However ANGLE currently append the second primitive after the first primitive.

The problem is that ANGLE considers that if the offset has not changed between 
two draw calls then we should append to the buffer. On the second call to 
glBindBufferRange, the offset is still zero even though the counter used 
internally by the GPU has been incremented and after glBindBufferRange, the 
offset is still zero. In ANGLE, glBindBufferRange is a no-op if the offset is 
set to the same value as before.

I am aware of two possible solutions:
* Set the offset to -1 in the state vector after each draw call and assume that 
-1 means "append";
* Invalidate the applied offset when glBindBufferRange/Base is called.

I am not quite sure which one is the best. I like the first solution but it 
involves removing the const-ref from the state pointer in a lot of places.

Original issue reported on code.google.com by Gregory....@imgtec.com on 27 Jan 2015 at 6:48

GoogleCodeExporter commented 9 years ago
https://chromium-review.googlesource.com/#/c/243892/2

Original comment by Gregory....@imgtec.com on 28 Jan 2015 at 4:13