This function will get the current GPU state, returning it as a DS Map. This can then be manipulated or even saved, and you can return this map to the GPU using the function gpu_set_state().
gpu_get_state();
gpu_map = gpu_get_state();
The above code stores the current GPU state in a variable.