gpu: dispatch compute after scene draw

This moves the compute shaders to run immediately after scene draw,
instead of in the draw() callback, which happens much later. All models
in the scene have been queued by the time, but since it is so early in
the ui drawing, it gives a few more ms for the compute to run before the
result needs to be used to draw the next frame.
This commit is contained in:
Adam
2020-12-28 13:54:44 -05:00
parent fd9626495b
commit 0fc1a94088
2 changed files with 170 additions and 119 deletions

View File

@@ -52,7 +52,21 @@ public interface DrawCallbacks
boolean drawFace(Model model, int face);
/**
* Called before the scene is drawn
* @param cameraX
* @param cameraY
* @param cameraZ
* @param cameraPitch
* @param cameraYaw
* @param plane
*/
void drawScene(int cameraX, int cameraY, int cameraZ, int cameraPitch, int cameraYaw, int plane);
/**
* Called after the scene has been drawn
*/
void postDrawScene();
void animate(Texture texture, int diff);
}