Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2020-09-12 17:22:34 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-09-12 17:22:34 +0300
commit6bc0a8424e9b794accf70534ed55478337f0e3e3 (patch)
tree86a198926ab024fbf696bb687344c2cfabbeb0c7
parent0639f008b6027d9ae1f29a5ecef835333b039b7e (diff)
Cleanup: GPU: Rename GPUStateManager to StateManager to follow style
-rw-r--r--source/blender/gpu/intern/gpu_context_private.hh2
-rw-r--r--source/blender/gpu/intern/gpu_state.cc16
-rw-r--r--source/blender/gpu/intern/gpu_state_private.hh9
-rw-r--r--source/blender/gpu/opengl/gl_state.cc2
-rw-r--r--source/blender/gpu/opengl/gl_state.hh2
5 files changed, 14 insertions, 17 deletions
diff --git a/source/blender/gpu/intern/gpu_context_private.hh b/source/blender/gpu/intern/gpu_context_private.hh
index bc07bea4bb1..38f94b8dde9 100644
--- a/source/blender/gpu/intern/gpu_context_private.hh
+++ b/source/blender/gpu/intern/gpu_context_private.hh
@@ -46,7 +46,7 @@ class Context {
Shader *shader = NULL;
FrameBuffer *active_fb = NULL;
GPUMatrixState *matrix_state = NULL;
- GPUStateManager *state_manager = NULL;
+ StateManager *state_manager = NULL;
Immediate *imm = NULL;
/**
diff --git a/source/blender/gpu/intern/gpu_state.cc b/source/blender/gpu/intern/gpu_state.cc
index 01a07ee3e4f..a3d07b1e1db 100644
--- a/source/blender/gpu/intern/gpu_state.cc
+++ b/source/blender/gpu/intern/gpu_state.cc
@@ -40,7 +40,7 @@ using namespace blender::gpu;
#define SET_STATE(_prefix, _state, _value) \
do { \
- GPUStateManager *stack = Context::get()->state_manager; \
+ StateManager *stack = Context::get()->state_manager; \
auto &state_object = stack->_prefix##state; \
state_object._state = (_value); \
} while (0)
@@ -104,7 +104,7 @@ void GPU_write_mask(eGPUWriteMask mask)
void GPU_color_mask(bool r, bool g, bool b, bool a)
{
- GPUStateManager *stack = Context::get()->state_manager;
+ StateManager *stack = Context::get()->state_manager;
auto &state = stack->state;
uint32_t write_mask = state.write_mask;
SET_FLAG_FROM_TEST(write_mask, r, (uint32_t)GPU_WRITE_RED);
@@ -116,7 +116,7 @@ void GPU_color_mask(bool r, bool g, bool b, bool a)
void GPU_depth_mask(bool depth)
{
- GPUStateManager *stack = Context::get()->state_manager;
+ StateManager *stack = Context::get()->state_manager;
auto &state = stack->state;
uint32_t write_mask = state.write_mask;
SET_FLAG_FROM_TEST(write_mask, depth, (uint32_t)GPU_WRITE_DEPTH);
@@ -141,7 +141,7 @@ void GPU_state_set(eGPUWriteMask write_mask,
eGPUStencilOp stencil_op,
eGPUProvokingVertex provoking_vert)
{
- GPUStateManager *stack = Context::get()->state_manager;
+ StateManager *stack = Context::get()->state_manager;
auto &state = stack->state;
state.write_mask = (uint32_t)write_mask;
state.blend = (uint32_t)blend;
@@ -160,7 +160,7 @@ void GPU_state_set(eGPUWriteMask write_mask,
void GPU_depth_range(float near, float far)
{
- GPUStateManager *stack = Context::get()->state_manager;
+ StateManager *stack = Context::get()->state_manager;
auto &state = stack->mutable_state;
copy_v2_fl2(state.depth_range, near, far);
}
@@ -172,7 +172,7 @@ void GPU_line_width(float width)
void GPU_point_size(float size)
{
- GPUStateManager *stack = Context::get()->state_manager;
+ StateManager *stack = Context::get()->state_manager;
auto &state = stack->mutable_state;
/* Keep the sign of point_size since it represents the enable state. */
state.point_size = size * ((state.point_size > 0.0) ? 1.0f : -1.0f);
@@ -184,7 +184,7 @@ void GPU_point_size(float size)
/* TODO remove and use program point size everywhere */
void GPU_program_point_size(bool enable)
{
- GPUStateManager *stack = Context::get()->state_manager;
+ StateManager *stack = Context::get()->state_manager;
auto &state = stack->mutable_state;
/* Set point size sign negative to disable. */
state.point_size = fabsf(state.point_size) * (enable ? 1 : -1);
@@ -327,7 +327,7 @@ void GPU_memory_barrier(eGPUBarrier barrier)
* exceptions that we should try to get rid of.
* \{ */
-GPUStateManager::GPUStateManager(void)
+StateManager::StateManager(void)
{
/* Set default state. */
state.write_mask = GPU_WRITE_COLOR;
diff --git a/source/blender/gpu/intern/gpu_state_private.hh b/source/blender/gpu/intern/gpu_state_private.hh
index a21093f00a2..d85375a85bb 100644
--- a/source/blender/gpu/intern/gpu_state_private.hh
+++ b/source/blender/gpu/intern/gpu_state_private.hh
@@ -98,9 +98,6 @@ union GPUStateMutable {
/* Viewport State */
/** TODO remove */
float depth_range[2];
- /** TODO remove, use explicit clear calls. */
- float clear_color[4];
- float clear_depth;
/** Negative if using program point size. */
/* TODO(fclem) should be passed as uniform to all shaders. */
float point_size;
@@ -152,14 +149,14 @@ inline GPUStateMutable operator~(const GPUStateMutable &a)
* State manager keeping track of the draw state and applying it before drawing.
* Base class which is then specialized for each implementation (GL, VK, ...).
**/
-class GPUStateManager {
+class StateManager {
public:
GPUState state;
GPUStateMutable mutable_state;
public:
- GPUStateManager();
- virtual ~GPUStateManager(){};
+ StateManager();
+ virtual ~StateManager(){};
virtual void apply_state(void) = 0;
diff --git a/source/blender/gpu/opengl/gl_state.cc b/source/blender/gpu/opengl/gl_state.cc
index 93753768928..3c577bf1ccd 100644
--- a/source/blender/gpu/opengl/gl_state.cc
+++ b/source/blender/gpu/opengl/gl_state.cc
@@ -42,7 +42,7 @@ namespace blender::gpu {
/** \name GLStateManager
* \{ */
-GLStateManager::GLStateManager(void) : GPUStateManager()
+GLStateManager::GLStateManager(void) : StateManager()
{
/* Set other states that never change. */
glEnable(GL_TEXTURE_CUBE_MAP_SEAMLESS);
diff --git a/source/blender/gpu/opengl/gl_state.hh b/source/blender/gpu/opengl/gl_state.hh
index b636c08ec0d..b98c4b300f3 100644
--- a/source/blender/gpu/opengl/gl_state.hh
+++ b/source/blender/gpu/opengl/gl_state.hh
@@ -40,7 +40,7 @@ class GLTexture;
* State manager keeping track of the draw state and applying it before drawing.
* Opengl Implementation.
**/
-class GLStateManager : public GPUStateManager {
+class GLStateManager : public StateManager {
public:
/** Anothter reference to the active framebuffer. */
GLFrameBuffer *active_fb = nullptr;