3 ms·
Is it practical to create a driver abstraction that masks cross vendor issues and provides a consistent interface to the dev? Like what jquery did for browsers.
by veesahni 12y ago
Is it practical to create a driver abstraction that masks cross vendor issues and provides a consistent interface to the dev? Like what jquery did for browsers.
- Negitivefrags 12y agoYes. It's called OpenGL.
- cleversoap 12y agoA lot of engines do this to some extent (eg. OGRE3D, Irrlicht, et al.) but there are pitfalls there as well. While jquery does a good job of shimming in hacks for older browsers the world of graphics programming isn't really that flexible and even newer drivers can still be a total grab bag of what they support - think of it like this: you have the latest version of Firefox and you can support everything but rendering text in italics. How would you shim that in? Can you? What if it tells you it supports it but it actually slants text the other way? What if it renders correctly but doing it the normal way takes an hour but there's a hack for only this operating system and version of Gecko that works. Also there really isn't a manual and StackOverflow is full of questions that contain all your search terms but are actually for a completely unrelated matter. So you drop it from the common interface that your abstraction presents because it's just not consistent enough.... There are also a TONNE of shader abstraction languages that transcribe to HLSL or GLSL on the fly for the same reason. tldr; Engine developers stare into the abyss and somehow the abyss gives back a projection matrix.
- exDM69 12y ago> Is it practical to create a driver abstraction that masks cross vendor issues and provides a consistent interface to the dev? Like what jquery did for browsers. Yes and no. The situation with OpenGL and drivers is quite different to browsers and jQuery. OpenGL drivers are generally quite good in implementing the API as it is specified and this is tested with a huge bunch of conformance suites. It's not like ancient browsers where one vendor's understanding of the CSS box model is different from the others'. However, OpenGL has a huge number of different versions, some require hardware support (major versions like GL 4.x vs. 3.x), while others might be software only additions (minor versions, GL 3.2 to 3.3). And then there are lots of API extensions that may or may not be available. This is a relatively simple problem to solve and we have tools like Regal and ANGLE to patch the little things. But the real problem is functional bugs. Incorrect pixels on the screen ranging from a minor annoyance to a completely destroyed image. And more severe issues like application crashes, completely corrupted display/desktop to blue screens and kernel hangs. This is something that cannot be fixed.