There are actually already multiple portable GPU bytecodes- this is how shaders are defined. DirectX's HLSL has a bytecode, and Vulkan's SPIR-V is a bytecode designed to be a target for GLSL, HLSL, or whatever other language people want to write shader compilers for. GLSL is sort of an exception in that the driver accepts the shader source rather than a bytecode, but the principle is the same.Brendan wrote:I think you're assuming that some sort of "portable byte code to GPU specific machine code" compiler exists. It doesn't. Someone would have to write it first.
...which is exactly what "apples to oranges" means here, because you've moved the boundary of the driver in one case but not the other, and then ignored the fact that the boundary is actually irrelevant because you can still reuse the rendering engine anyway.Brendan wrote:I'm comparing "everything above the driver's abstraction" in both cases.
Please, feel free to replace "library" with "service" and read the rest. It makes no difference whatsoever to the API design, so your ignoring it is rather childish.Brendan wrote:I have no reason to read anything beyond this. I refuse to support libraries for any reason whatsoever.
All false, because you've confused the concept of a low level API with the concept of a crappy library implementation, which (again) makes no difference whatsoever to the API design. And even if you were to use libraries, you would have several choices to remedy these problems:Brendan wrote:
- If "whole process optimisation" is involved:
- You'd added a massive amount of bloat to every single process
- You've forced a developer to wager their reputation on the quality of the library's code
- It's not possible to upgrade/replace it later
- If "whole process optimisation" is not involved:
- Performance sucks due to poor optimisation
- You've forced a developer to wager their reputation on the quality of the library's code, and that library is no longer under the developers control
Dynamic linking is the closest to services: The whole-program optimizer has the same amount of information and thus creates the same amount of "bloat" and "poor optimization;" The developer's reputation is "wagered" on something out of their control (yes, services do this too); Later replacement is possible.
Of course, you already want a portable bytecode, which is an even better solution: The whole-program optimizer can control exactly how much of the library to inline, to avoid bloat while improving performance beyond what's possible with services; Later replacement is even easier because distributed code is portable.
The only flexibility I've destroyed is the flexibility for the driver to be inconsistent, which I already mentioned as an advantage for you but a disadvantage for me. The only things you would possibly want to do to a game's video at a higher level than framebuffers are, to me, idiotic novelties. Even the idea of streaming higher-level data across a network to play a game remotely is much better served with game-specific protocols. The times you would want to manipulate things at a higher level are e.g. GUIs, which you already want a more specific protocol for than meshes/lights/camera.Brendan wrote:
- You've assumed processes only ever send their video, and forgotton that normal processes have to understand the video sent by arbitrary processes, and either destroyed a massive amount of flexibility or added a massive amount of hassle for all processes that have to understand the "too low level" video sent by its children.