[Bf-blender-cvs] [9d81e937d23] blender2.8: Optimizadion: Fix performanse issue of UI on some old GPUs.
mano-wii
noreply at git.blender.org
Mon Oct 22 17:59:29 CEST 2018
Commit: 9d81e937d234f8c2be38550d25fcb0945066fb25
Author: mano-wii
Date: Mon Oct 22 12:58:29 2018 -0300
Branches: blender2.8
https://developer.blender.org/rB9d81e937d234f8c2be38550d25fcb0945066fb25
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.
===================================================================
M source/blender/gpu/shaders/gpu_shader_2D_widget_base_vert.glsl
===================================================================
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),
More information about the Bf-blender-cvs
mailing list