diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-08-16 18:38:07 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-08-16 23:34:02 +0300 |
commit | 7c96f613e4d05f67f5cd9bf0cec29ca7ce51a3e4 (patch) | |
tree | 5d366b09edc069803d67c875e9ef65314eff87a9 /source/blender/gpu/shaders/gpu_shader_uniform_color_frag.glsl | |
parent | a4068d008304f2c609df0b2d8db5f987c86c1509 (diff) |
DwM: Use Batch's for drawing selection
Use mesh batch cache for mesh selection.
Note that we could create the batches and free immediately
so they don't take up memory.
This resolves a problem where selection was limited
to immediate-mode buffer size.
Diffstat (limited to 'source/blender/gpu/shaders/gpu_shader_uniform_color_frag.glsl')
-rw-r--r-- | source/blender/gpu/shaders/gpu_shader_uniform_color_frag.glsl | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_uniform_color_frag.glsl b/source/blender/gpu/shaders/gpu_shader_uniform_color_frag.glsl index 5dd1352adc5..118a661863d 100644 --- a/source/blender/gpu/shaders/gpu_shader_uniform_color_frag.glsl +++ b/source/blender/gpu/shaders/gpu_shader_uniform_color_frag.glsl @@ -1,9 +1,21 @@ +#if defined(USE_COLOR_U32) +uniform uint color; +#else uniform vec4 color; +#endif out vec4 fragColor; void main() { +#if defined(USE_COLOR_U32) + fragColor = vec4( + ((color ) & uint(0xFF)) * (1.0f / 255.0f), + ((color >> 8) & uint(0xFF)) * (1.0f / 255.0f), + ((color >> 16) & uint(0xFF)) * (1.0f / 255.0f), + ((color >> 24) ) * (1.0f / 255.0f)); +#else fragColor = color; +#endif } |