diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-08-16 15:01:07 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-08-18 22:30:10 +0300 |
commit | 2ae1c895a2f7590d0783a27176085da45ef12bc5 (patch) | |
tree | e4cb63134deaca31908b4e9ddfff96614bfa1e0e /source/blender/gpu/intern/gpu_state.cc | |
parent | 2eddfa85e00d9efa7571721e605a331ca4cd5bc6 (diff) |
GPUState: Add GL backend and state tracking but do not use it
This is just the backend work. It is not plugged in yet because it
needs more external cleanup/refactor.
Diffstat (limited to 'source/blender/gpu/intern/gpu_state.cc')
-rw-r--r-- | source/blender/gpu/intern/gpu_state.cc | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/source/blender/gpu/intern/gpu_state.cc b/source/blender/gpu/intern/gpu_state.cc index d697b465458..485aa3b852e 100644 --- a/source/blender/gpu/intern/gpu_state.cc +++ b/source/blender/gpu/intern/gpu_state.cc @@ -33,6 +33,10 @@ #include "GPU_glew.h" #include "GPU_state.h" +#include "gpu_state_private.hh" + +using namespace blender::gpu; + static GLenum gpu_get_gl_blendfunction(eGPUBlendFunction blend) { switch (blend) { @@ -78,7 +82,7 @@ void GPU_blend_set_func_separate(eGPUBlendFunction src_rgb, gpu_get_gl_blendfunction(dst_alpha)); } -void GPU_face_culling(eGPUFaceCull culling) +void GPU_face_culling(eGPUFaceCullTest culling) { if (culling == GPU_CULL_NONE) { glDisable(GL_CULL_FACE); @@ -269,6 +273,35 @@ bool GPU_mipmap_enabled(void) return true; } +/* -------------------------------------------------------------------- */ +/** \name Draw State (DRW_state) + * \{ */ + +void GPUStateStack::push_stack(void) +{ + stack[stack_top + 1] = stack[stack_top]; + stack_top++; +} + +void GPUStateStack::pop_stack(void) +{ + stack_top--; +} + +void GPUStateStack::push_mutable_stack(void) +{ + mutable_stack[mutable_stack_top + 1] = mutable_stack[mutable_stack_top]; + mutable_stack_top++; +} + +void GPUStateStack::pop_mutable_stack(void) +{ + mutable_stack_top--; +} + +/** \} */ + +/* -------------------------------------------------------------------- */ /** \name GPU Push/Pop State * \{ */ |