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-08-17 19:11:09 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-08-18 22:30:10 +0300
commita9f2ebb215084debae70099b3d2e58195d9a9e32 (patch)
tree839b142dc49f8d6727a4d6e076a6227ea2e573d2 /source/blender/gpu/intern/gpu_state.cc
parent536c2e0ec916eb49c534b4937b36da278dbe2364 (diff)
Cleanup: DRW: Use GPUState instead of raw opengl calls
Should not break anything! Huh!
Diffstat (limited to 'source/blender/gpu/intern/gpu_state.cc')
-rw-r--r--source/blender/gpu/intern/gpu_state.cc37
1 files changed, 37 insertions, 0 deletions
diff --git a/source/blender/gpu/intern/gpu_state.cc b/source/blender/gpu/intern/gpu_state.cc
index 039bce1f0ac..619f52da852 100644
--- a/source/blender/gpu/intern/gpu_state.cc
+++ b/source/blender/gpu/intern/gpu_state.cc
@@ -121,11 +121,35 @@ void GPU_depth_mask(bool depth)
state.write_mask = write_mask;
}
+void GPU_shadow_offset(bool enable)
+{
+ SET_IMMUTABLE_STATE(shadow_bias, enable);
+}
+
void GPU_clip_distances(int distances_enabled)
{
SET_IMMUTABLE_STATE(clip_distances, distances_enabled);
}
+void GPU_state_set(eGPUWriteMask write_mask,
+ eGPUBlend blend,
+ eGPUFaceCullTest culling_test,
+ eGPUDepthTest depth_test,
+ eGPUStencilTest stencil_test,
+ eGPUStencilOp stencil_op,
+ eGPUProvokingVertex provoking_vert)
+{
+ GPUStateManager *stack = GPU_context_active_get()->state_manager;
+ auto &state = stack->state;
+ state.write_mask = write_mask;
+ state.blend = blend;
+ state.culling_test = culling_test;
+ state.depth_test = depth_test;
+ state.stencil_test = stencil_test;
+ state.stencil_op = stencil_op;
+ state.provoking_vert = provoking_vert;
+}
+
/** \} */
/* -------------------------------------------------------------------- */
@@ -185,6 +209,19 @@ void GPU_viewport(int x, int y, int width, int height)
copy_v4_v4_int(state.viewport_rect, viewport_rect);
}
+void GPU_stencil_reference_set(uint reference)
+{
+ SET_MUTABLE_STATE(stencil_reference, (uint8_t)reference);
+}
+void GPU_stencil_write_mask_set(uint write_mask)
+{
+ SET_MUTABLE_STATE(stencil_write_mask, (uint8_t)write_mask);
+}
+void GPU_stencil_compare_mask_set(uint compare_mask)
+{
+ SET_MUTABLE_STATE(stencil_compare_mask, (uint8_t)compare_mask);
+}
+
/** \} */
/* -------------------------------------------------------------------- */