Clarity on GPU sync timing - Or why SDL_Delay?

I don’t think that’s a chatbot; I think it’s a very young developer — probably still in college if not younger — who doesn’t yet understand the concept of engineering tolerances, resource constraints, or “Worse Is Better,” due to lack of exposure to real-world development projects.

Mason,

I have witnessed during the many years at Apple, that all those “concepts of limits…” only exist as illusions at extremely low levels of brain function, where the people do not operate at the full capacity available to them.

What has been witnessed, was that if people were cured of the health problems, the limits, cease to exist.

This fact offends people, who hold lower spaces.

They cling to the lower space, even when it is presented plainly, and offered generously.

They fight the very notion that, they can be easily cured and access real intelligence and bypass all their “limits” and previous life experiences.

That group, tends to defend/deflect/divert, in so many subtle ways, as to reject the communication, and remain in the lower spaces.

They never find out, and choose to tell themselves, all sort of stories like you all are, and gather by affinity with others who share the same low cognitive space, to assure each other, that it can not be true.

The small number of people on earth which are using knowledge of matter to amplify brain function, are mostly not talking with you, in your circles. Even if one of them were to come to your circle, as an outsider, you would have no capacity to understand them, because you can only view people in terms of your limited life experiences, as you have not yet begun to live in fuller brain capacity spaces. You can not understand the wider space, from the narrow one.

A person like me says, “We have figured out how to live without solid food, using quality technology”.

You can not conceive the full depth of that, and all the ramifications that are well beyond the zone of food.

The men who still eat animals and plants, have a great many notions of shallow limits and the “need” for certain things. They will argue endlessly that they must violently kill plants to survive and a million confused notions, because of failure to listen and heed those who are now understanding matter itself.

They would be completely immersed in a great labyrinth of food production, processing, distribution, and so on, and have a huge inner world of sunk costs and purported “engineering limits and constraints” that arise from an origin point of ignorance and negligence to listen.

The space of software developers is just like that. You assume a great many limits, because you live entirely in lower realms where such problems occur. And when you are offered to join a higher space freely, you all act in self-defense of your supposed intelligence and life experiences of “real limits”.

If the people were mature enough to simply be plainly told, and accept the reality, we could move at a much faster speed in curing their physical brains.

The reason it has been so slow at companies like Apple and Google, has been this type of inability to listen and accept what their neighbors are now doing with nuclear reactors.

We are doing a thousand things which are so far advanced, that it is now completely alien to you, and we are accelerating at a fast rate.

Just because I could read your software landscape faster than a computer, and rapidly bypass your level in days, does not mean I am a computer.

It just means I’m using technology which allows amplification of brain function, which is too unbelievable for you to accept, and much wider than your capacity to understand, until after you also, are operating with fuller brain ability. As long as you continue to reject it, and remain at your low level, you will have no capacity to ever find out how I and others are beginning to live.

As I said, I am building clean “nuclear reactors”.

But I am not doing what you think I am doing. You have been misinformed what a reactor is, because there are many people like you who also make “reactors”, and many things, and so you have a thousand underlying false notions from the majority space, that block you from understanding and block you from simple actions of doing.

What you can do with a metal rock, is limited by your intelligence level, and your underlying false notions about the situation with matter and electronics, that is popular in your circle.

If your group can not listen and heed what is being plainly stated to you, we will simply remain silent and perform the work without your awareness.

It is simply faster, if you all can be mature enough to drop your pride and realize what is now going on, and then you can get cured of the brain problem, and do what we are doing too… instead of having a million of you ignorantly continue to do wrong at scale and diminish your own capacity for intelligence.

The original topic of this thread, was to get clarity on why there is a bad approach in SDL for gpu synchronization.

The answer, is clearly that there is a problem with the brains of the people making vulkan and the immaturity of the people using SDL in this community. If this community was not immature, and had real intelligence, they would grasp what I have stated plainly, and go bypass vulkan, and bypass Windows and Apple, and reorganize a more professional quality system.

But you would rather believe in your shallow engineering limits, and your self-image of intelligence, than accept what has been relayed to you plainly.

Full disclosure, I didn’t read most of this thread, but I got an admin notice that the post was flagged, so I’m popping in to provide some clarity real fast:

  • SDL doesn’t rely on SDL_Delay for frame timing (but if we’re looking for frame limiting, it does tend to rely on vsync). SDL will render as fast as the GPU will let you, which might be significantly faster than the refresh rate of the display, or it might be exactly the refresh rate of the display, depending on many factors. (I think some code went into SDL recently to simulate vsync on the software renderer, but that’s kind of a corner case.)
  • SDL_Delay is not a good way to give up CPU time when precision is required, because no OS will promise to reawaken your process at any specific moment through this mechanism; it’s possible you put it to sleep for 10 milliseconds and the OS decides to get back around to you in 50. It’s also possible that you ask to sleep for 1 and the OS decides it’s too short a time and just busy-loops, so no other process gets time and you burn battery. There are uses for SDL_Delay, but in many, many cases, it’s better to find a way to express “I am waiting for a specific thing to happen, please put this thread to sleep until that occurs.” Vsync is one of those specific things.
  • What Apple is doing here is possibly more efficient and precise, but it requires a control inversion, which is often painful to adapt existing code to, and is generally not how games are written for any platform (including macOS). To suggest what Apple is doing is the only way to make a game that runs well and doesn’t stutter is to say that almost every game ever written runs poorly and stutters. Which is to say: finding a better way is always a positive, but saying existing ways are completely untenable is not accurate.
  • That being said: Apple is not alone in this! If you’re targeting Emscripten, a rendering callback is a hard requirement, as Javascript on the main thread must return control at the end of the frame. If you’re building a libretro core, you have to structure it so you render a frame on demand and you don’t have a main loop (or a main function) at all. Other platforms might require this in the future. As such, figuring out what to do about this is something we’re talking about (but have made no decisions for yet) in SDL3. That discussion is here.

One last note:

  • Everyone please have patience with each other. Sometimes people don’t understand and gentle clarification is helpful. Other times they just disagree, and that’s okay, too. It took me a long time to learn that I don’t have to bust out the Socratic Method on every technical discussion with people on the Internet, so learn from my mistakes and let people be wrong sometimes. :slight_smile:
4 Likes