GM:S 1.4 Optimizing Batch Calls

Discussion in 'Programming' started by jirrev, Jun 27, 2016.

  1. jirrev

    jirrev Guest

    Hello everyone,

    I am currently busy with polishing my game and have reached the moment I want to optimize my rendering Pipeline. I have looked into quiet a lot of documentation myself and have done my fair share of fixes so far.

    Nevertheless, I was wondering, during the progress of my game I sometimes create surfaces, audio sync-groups and what not. I have used a garbage collector to clean those up, but would like to run a full clean when I reach a certain moment (just to be sure). Does anyone know how to access all sync-groups and dynamicly created resources like surfaces and clean them all up? (that is without a variable refference).

    Any other personal tips for optimization are welcome too!

    Yours truly,
    Jirrev
     
  2. graviax

    graviax Guest

    sorry to ask a question where you asked for an answer but,
    rendering pipeline isn't only for 3D rendering? (3D to 2D)
     
  3. jo-thijs

    jo-thijs Member

    Joined:
    Jun 20, 2016
    Posts:
    2,844
    There's no official/supported way.

    For surfaces, you could create a new empty surface.
    Its id will be the id of the highest surface created before +1.
    You can then loop through every id from 0 to the new surface id
    and check if a surface with that id exists and if so, free it.

    This doesn't work for audio groups, but there you could keep track of the amount of audio groups you've created so far and loop through every id from 0 to that number.

    That being said, I highly disrecommend you actually do that.
    You should manage the resources yourself and don't garbage collect them.
    Normally seen, you should be able to predict exactly when which surface should be freed,
    so you should free every surface then yourself.
    The same for audio sync groups.
     
  4. jirrev

    jirrev Guest

    Thanks for the reply, I have indeed taken care to free them when they are rady but I want to make a final sweep once an itteration of the game is finished (when a match is over)

    As for your question, all things that are put on screen go through a rendering pipeline, both 2D and 3D. This is simply the action of collecting all draw calls and drawing them on top of eachother. 3D is far more advanced ofcourse but it still happens in 2D.
     
    graviax likes this.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice