<p>In any modern desktop hardware, there shouldn't be: uniform buffers will just be memory blobs read by the shader. (See also: <a href="https://www.opengl.org/wiki/Uniform_Buffer_Object" rel="nofollow">Uniform Buffer Objects</a>)</p>

CC BY-SA 3.0
2015-08-25T05:19:19.273Z
2015-08-25T05:19:19.273Z
yuriks
<p>I'd like to know if there's any performance impact based on how I struct my shader uniforms. For instance, is passing 4 floats worse than passing a single vec4?</p>

CC BY-SA 3.0
2015-08-24T23:36:28.950Z
This is going to be a zero net comment, but... just wanted to mention, if you are unsure of performance, you could profile and see.  But, of course, there might be different characteristics on different hardware that you might not have access to, and you may not be aware of the ways it might be faster or slower.  Like, texture reads are really cheap til you are texture read bound :P
Alan Wolfe
CC BY-SA 3.0
2015-08-31T21:50:42.060Z
Desktop or mobile? Uniforms can be surprisingly costly on some mobile GPUs.
Noah Witherspoon
<performance><glsl><shader>
Shader uniform performance
Felipe Lira
# Shader uniform performance

(Asked by: username_0 on 2015-08-24)

I'd like to know if there's any performance impact based on how I struct my shader uniforms. For instance, is passing 4 floats worse than passing a single vec4?

**Tags:** performance, glsl, shader

> **Comments:**
> **username_1**: This is going to be a zero net comment, but... just wanted to mention, if you are unsure of performance, you could profile and see.  But, of course, there might be different characteristics on different hardware that you might not have access to, and you may not be aware of the ways it might be faster or slower.  Like, texture reads are really cheap til you are texture read bound :P  
> **username_2**: Desktop or mobile? Uniforms can be surprisingly costly on some mobile GPUs.  

---

## 1 answers

### Answer by username_3 on 2015-08-25. Score: 2

In any modern desktop hardware, there shouldn't be: uniform buffers will just be memory blobs read by the shader. (See also: [Uniform Buffer Objects](https://www.opengl.org/wiki/Uniform_Buffer_Object))


---

