diff options
author | mano-wii <germano.costa@ig.com.br> | 2018-10-22 18:58:29 +0300 |
---|---|---|
committer | mano-wii <germano.costa@ig.com.br> | 2018-10-22 18:59:09 +0300 |
commit | 9d81e937d234f8c2be38550d25fcb0945066fb25 (patch) | |
tree | 042a6a1097185397c0fa4335ee896b93b38eb6b6 /source/blender/gpu | |
parent | 650cdc6b2d91b12a80d7c8e680224c4713cfeb5e (diff) |
Optimizadion: Fix performanse issue of UI on some old GPUs.
Apparently the registry is not large enough and the compiler does something bad in indexing the array.
Diffstat (limited to 'source/blender/gpu')
-rw-r--r-- | source/blender/gpu/shaders/gpu_shader_2D_widget_base_vert.glsl | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_2D_widget_base_vert.glsl b/source/blender/gpu/shaders/gpu_shader_2D_widget_base_vert.glsl index bffad940103..7db0029e64d 100644 --- a/source/blender/gpu/shaders/gpu_shader_2D_widget_base_vert.glsl +++ b/source/blender/gpu/shaders/gpu_shader_2D_widget_base_vert.glsl @@ -47,7 +47,11 @@ const vec2 jit[9] = vec2[9]( /* We can reuse the CORNER_* bits for tria */ #define TRIA_VEC_RANGE BIT_RANGE(6) -const vec2 triavec[43] = vec2[43]( + +/* Some GPUs have performanse issues with this array being const (Doesn't fit in the registers?). + * To resolve this issue, store the array as a uniform buffer. + * (The array is still stored in the registry, but indexing is done in the uniform buffer.) */ +uniform vec2 triavec[43] = vec2[43]( /* ROUNDBOX_TRIA_ARROWS */ vec2(-0.170000, 0.400000), vec2(-0.050000, 0.520000), vec2( 0.250000, 0.000000), vec2( 0.470000, -0.000000), vec2(-0.170000, -0.400000), vec2(-0.050000, -0.520000), |