diff options
author | Jeroen Bakker <jeroen@blender.org> | 2020-11-04 16:14:38 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2020-11-04 16:14:38 +0300 |
commit | 5af9b9f45be08368a7fa3965805f53f012401631 (patch) | |
tree | 9b44b9d69a635eda95d3da236c0ea05de4a73123 /source/blender/gpu | |
parent | 17ccda4fe1c4bcc206024af3244c44678791a685 (diff) | |
parent | 3ffa0452af9ac0a08b321e9504c9e080ab1ce47d (diff) |
Merge branch 'blender-v2.91-release'
Diffstat (limited to 'source/blender/gpu')
-rw-r--r-- | source/blender/gpu/GPU_state.h | 1 | ||||
-rw-r--r-- | source/blender/gpu/opengl/gl_state.cc | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/gpu/GPU_state.h b/source/blender/gpu/GPU_state.h index b7bea4b0a08..f5a1ccbc40b 100644 --- a/source/blender/gpu/GPU_state.h +++ b/source/blender/gpu/GPU_state.h @@ -71,6 +71,7 @@ typedef enum eGPUBlend { /** Custom blend parameters using dual source blending : SRC0 + SRC1 * DST * NOTE: Can only be used with _ONE_ Draw Buffer and shader needs to be specialized. */ GPU_BLEND_CUSTOM, + GPU_BLEND_ALPHA_UNDER_PREMUL, } eGPUBlend; typedef enum eGPUDepthTest { diff --git a/source/blender/gpu/opengl/gl_state.cc b/source/blender/gpu/opengl/gl_state.cc index 27c9b501add..3a474da8b8e 100644 --- a/source/blender/gpu/opengl/gl_state.cc +++ b/source/blender/gpu/opengl/gl_state.cc @@ -421,6 +421,13 @@ void GLStateManager::set_blend(const eGPUBlend value) dst_alpha = GL_SRC_ALPHA; break; } + case GPU_BLEND_ALPHA_UNDER_PREMUL: { + src_rgb = GL_ONE_MINUS_DST_ALPHA; + dst_rgb = GL_ONE; + src_alpha = GL_ONE_MINUS_DST_ALPHA; + dst_alpha = GL_ONE; + break; + } case GPU_BLEND_CUSTOM: { src_rgb = GL_ONE; dst_rgb = GL_SRC1_COLOR; |