justingardner / mgl

A suite of mex/m files for displaying psychophysics stimuli
http://justingardner.net/mgl
Other
18 stars 22 forks source link

renderPipeline test #65

Closed justingardner closed 1 year ago

justingardner commented 2 years ago

I've added a function called mglTestRenderPipeline. The idea here is to have a function where we can add more things to the pipeline to test how fast things are working, and see where we can be more efficient if we are dropping frames. For now it just draws n number of quads. We should add full screen blts and dots as separate test functions and see where we stand with that. It should also have a portion of the screen that flickers white to black, so that we can test with a photometer that the reported system time is accurate.

justingardner commented 2 years ago

Render pipeline tests now have ones for quads, dots, textures and clear screen.

justingardner commented 2 years ago

The mglClearScreen takes two frames to run on my machine (does this have something to do with the earlier problem in getting clear screen to update)?

benjamin-heasly commented 2 years ago

OK yeah, I see that here too. The previous fix got the clear screen behavior to work after a single flush, but it did incur an extra frame wait after the fact, which I didn't realize.

My understanding is -- in metal the clear operation only happens at the start of a new frame/render pass when the frame buffer texture gets loaded. So we need to process the command before start of the next render pass, and then drop into the render loop right away. This makes it different from all the other commands we have, which either avoid creating a render pass, or happen within the drawing loop after the render pass is already started.

I think I have this resolved now and I'll push up the change soon (edit: it's up).

benjamin-heasly commented 2 years ago

To compliment mglTestRenderPipeline, I created some new commands that repeat a given stimulus in the Metal app , usually with randomization on each frame, for a number of frames. I created a separate issue just to call these out with a little commentary: https://github.com/justingardner/mgl/issues/67

Hopefully these will give us a comparison for how things behave with and without a socket round trip on every frame.

justingardner commented 1 year ago

Sounds like this is resolved. So closing.