diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-08-16 16:16:21 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-08-18 22:30:10 +0300 |
commit | 969bcf0793dca0e75bf42998aba92b1abd90ec23 (patch) | |
tree | 26456f72a028a27e32b0311072749e34813894fe /source/blender/gpu/intern | |
parent | a1459b2f7a53fc9e7a52260e975c47c48c6c383d (diff) |
Cleanup: GPUState: Replace blend func separate by enum
Diffstat (limited to 'source/blender/gpu/intern')
-rw-r--r-- | source/blender/gpu/intern/gpu_state.cc | 29 |
1 files changed, 2 insertions, 27 deletions
diff --git a/source/blender/gpu/intern/gpu_state.cc b/source/blender/gpu/intern/gpu_state.cc index d2aa0816a3f..be4450193f5 100644 --- a/source/blender/gpu/intern/gpu_state.cc +++ b/source/blender/gpu/intern/gpu_state.cc @@ -46,25 +46,6 @@ using namespace blender::gpu; // GLStateStack::set_blend(blend); // } -static GLenum gpu_get_gl_blendfunction(eGPUBlendFunction blend) -{ - switch (blend) { - case GPU_ONE: - return GL_ONE; - case GPU_SRC_ALPHA: - return GL_SRC_ALPHA; - case GPU_ONE_MINUS_SRC_ALPHA: - return GL_ONE_MINUS_SRC_ALPHA; - case GPU_DST_COLOR: - return GL_DST_COLOR; - case GPU_ZERO: - return GL_ZERO; - default: - BLI_assert(!"Unhandled blend mode"); - return GL_ZERO; - } -} - void GPU_blend(bool enable) { if (enable) { @@ -94,15 +75,9 @@ void GPU_blend_set_func(eGPUBlendFunction sfactor, eGPUBlendFunction dfactor) } } -void GPU_blend_set_func_separate(eGPUBlendFunction src_rgb, - eGPUBlendFunction dst_rgb, - eGPUBlendFunction src_alpha, - eGPUBlendFunction dst_alpha) +void GPU_blend_set_func_separate(eGPUBlend blend) { - glBlendFuncSeparate(gpu_get_gl_blendfunction(src_rgb), - gpu_get_gl_blendfunction(dst_rgb), - gpu_get_gl_blendfunction(src_alpha), - gpu_get_gl_blendfunction(dst_alpha)); + GLStateStack::set_blend(blend); } void GPU_face_culling(eGPUFaceCullTest culling) |