<p>It varies depending on the value you are getting. Some values come from files, such as values that are constant but GPU specific(inf files on windows if I remember correctly). Some come from the driver, run time values that are GPU specific. Some come from the GPU directly, values that are set directly or indirectly for a particular run.</p>
<p>How each driver implements all that is probably going to vary widely.</p>
<p>Values like the clear color and culling state are runtime, so the driver is going to be tracking it. The value will almost certainly be sitting on the user side so it won't incur a  system call. (So that would be CPU) So it is very likely the driver will be able to fill the value directly.</p>

CC BY-SA 4.0
2023-02-03T12:53:17.517Z
I am interested into values like `GL_COLOR_CLEAR_VALUE` or `GL_CULL_FACE` which can be set during the execution. When enabling culling for example, does the driver (CPU side) hold this value, so when executing `glIsEnabledi(GL_CULL_FACE, &dataToStoreValue);` it can directly fill the variable? Or does the driver need to receive the value from GPU?
Thomas
CC BY-SA 4.0
2023-02-03T14:48:30.123Z
@Thomas: What does it matter? You shouldn't be asking for it anyway because you're the one who *set* it. You should already know the answer. If this is about performance, you shouldn't be using any get functions if performance matters to you.
Nicol Bolas
CC BY-SA 4.0
2023-02-03T15:03:06.387Z
@NicolBolas yes it is about performance and the CPU is pretty much idle. I'm working on a big project where these values change frequently (depending on material information). To avoid graphics errors, I compare the current state with the target state to change only the values that need to be changed. The OpenGL methods are used at the moment and I want to exclude performance degradation due to these method calls.
Thomas
CC BY-SA 4.0
2023-02-03T15:11:18.663Z
It is very important to check these states because the software must have a very high technology readiness level. Graphics errors must be avoided, otherwise the damage can be incredibly high
Thomas
CC BY-SA 4.0
2023-02-03T12:40:32.827Z
2023-02-03T13:09:58.883Z
2023-02-03T13:09:58.883Z
pmw1234
<p>I know that the OpenGL driver is implemented by hardware vendors, so this questions may not have a consistent answer.</p>
<p>If I use one of the glGet methods, does OpenGL get the information from the GPU or from the CPU?</p>

<opengl>
Where does the OpenGL driver get the glGet values from?
Thomas
# Where does the OpenGL driver get the glGet values from?

(Asked by: username_0 on 2023-02-03)

I know that the OpenGL driver is implemented by hardware vendors, so this questions may not have a consistent answer.

If I use one of the glGet methods, does OpenGL get the information from the GPU or from the CPU?

**Tags:** opengl


---

## 1 answers

### Answer by username_1 on 2023-02-03. Score: 1 | Accepted answer

It varies depending on the value you are getting. Some values come from files, such as values that are constant but GPU specific(inf files on windows if I remember correctly). Some come from the driver, run time values that are GPU specific. Some come from the GPU directly, values that are set directly or indirectly for a particular run.

How each driver implements all that is probably going to vary widely.

Values like the clear color and culling state are runtime, so the driver is going to be tracking it. The value will almost certainly be sitting on the user side so it won't incur a system call. (So that would be CPU) So it is very likely the driver will be able to fill the value directly.

> **Comments:**
> **username_0**: I am interested into values like `GL_COLOR_CLEAR_VALUE` or `GL_CULL_FACE` which can be set during the execution. When enabling culling for example, does the driver (CPU side) hold this value, so when executing `glIsEnabledi(GL_CULL_FACE, &dataToStoreValue);` it can directly fill the variable? Or does the driver need to receive the value from GPU?  
> **username_2**: @username_0: What does it matter? You shouldn't be asking for it anyway because you're the one who *set* it. You should already know the answer. If this is about performance, you shouldn't be using any get functions if performance matters to you.  
> **username_0**: @username_2 yes it is about performance and the CPU is pretty much idle. I'm working on a big project where these values change frequently (depending on material information). To avoid graphics errors, I compare the current state with the target state to change only the values that need to be changed. The OpenGL methods are used at the moment and I want to exclude performance degradation due to these method calls.  
> **username_0**: It is very important to check these states because the software must have a very high technology readiness level. Graphics errors must be avoided, otherwise the damage can be incredibly high  

---

