developer
developer

Reputation: 678

GPU, Shader Compiler and OpenGL Application

I have an OpenGL application which is using shaders.On the desktop where I have a graphics card and the driver installed it works fine, but when the GPU is disabled my application does not run and crashes after window creation. I have the below understandings and doubts:

Upvotes: 0

Views: 898

Answers (3)

datenwolf
datenwolf

Reputation: 162327

  • The GLSL compiler is provided by the GPU vendor, so the application crashes when there is no GPU driver found.

Well, technically the GLSL compiler is part of a conforming OpenGL implementation of high enough version. But that's just big words for essentially, what you said. So: Yes.

  • Does this mean that on system without GPU, OpenGL applications which uses shaders will not run?

You need a OpenGL implementation capable of the features your program needs. Most OpenGL implementations are done in form of a combination of GPU and a (thin) driver layer that makes it possible to talk to the GPU by OpenGL.

  • My understanding was that the GPU only enhances the fps and the app should run without GPU as well.

Well, that notion is wrong. A GPU is not a mere "performance enhancer". A GPU is a fully featured processing plattform and all OpenGL versions are designed to be implemented using this kind of processor, that GPUs are. There are software emulations, but those are slow and often not feature complete.

In fact OpenGL always was supposed to be implemented using some kind of GPU. The very first version of OpenGL was actually quite a literal 1:1 user space API of the registers and commands of SGI hardware graphics rasterizers; heck even some of the early OpenGL tokens have the numeric values put into SGI hardware's control registers.

Upvotes: 0

napcode
napcode

Reputation: 111

As previously stated someone needs to provide an OpenGL implementation on your target platform/system. Usually, this is done by the graphics driver but there are software implementation (like mesa) available too.

Additionally, in order for you application to run it needs to check the availability of certain OpenGL features as some things, like shaders, might no be available for every driver/implementation/hardware. To put it in different words: the availability of an OpenGL implementation (usually a shared library) does not indicate the availability of shaders.

To my knowledge most implementations do not provide a "software fallback" if no GPU is available. Mesa does but it "only" provides OpenGL 3.1 and I'm not sure how good shader support is for software rendering. I think it's work in progress.

Upvotes: 1

Vasaka
Vasaka

Reputation: 2022

In order to run OpenGL app you must have a driver that understands OpenGL calls, you can run your app without GPU though if you install software emulating driver. One is Mesa AFAIK there is a windows version of Mesa too, another is Swiftshader from transgaming, but latter is commercial software.

Upvotes: 0

Related Questions