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-23 12:06:52 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-08-23 13:04:24 +0300
commit72e78df4640f1de4427b32bd3e51a394db326987 (patch)
tree3880da6261b8d17dee904dc59f86c9b43791e17a /source/blender/gpu/intern
parented288a5786d66ae948b630cbc083fa9c8c9f0b89 (diff)
GPUState: Expose Stencil mask and test
This is to be used by framebuffer clearing.
Diffstat (limited to 'source/blender/gpu/intern')
-rw-r--r--source/blender/gpu/intern/gpu_state.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/source/blender/gpu/intern/gpu_state.cc b/source/blender/gpu/intern/gpu_state.cc
index 1be3b06fa34..f8d753f9ee7 100644
--- a/source/blender/gpu/intern/gpu_state.cc
+++ b/source/blender/gpu/intern/gpu_state.cc
@@ -79,6 +79,11 @@ void GPU_depth_test(eGPUDepthTest test)
SET_IMMUTABLE_STATE(depth_test, test);
}
+void GPU_stencil_test(eGPUStencilTest test)
+{
+ SET_IMMUTABLE_STATE(stencil_test, test);
+}
+
void GPU_line_smooth(bool enable)
{
SET_IMMUTABLE_STATE(line_smooth, enable);
@@ -212,10 +217,12 @@ 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);
@@ -239,12 +246,24 @@ eGPUWriteMask GPU_write_mask_get()
return (eGPUWriteMask)state.write_mask;
}
+uint GPU_stencil_mask_get()
+{
+ GPUStateMutable &state = GPU_context_active_get()->state_manager->mutable_state;
+ return state.stencil_write_mask;
+}
+
eGPUDepthTest GPU_depth_test_get()
{
GPUState &state = GPU_context_active_get()->state_manager->state;
return (eGPUDepthTest)state.depth_test;
}
+eGPUStencilTest GPU_stencil_test_get()
+{
+ GPUState &state = GPU_context_active_get()->state_manager->state;
+ return (eGPUStencilTest)state.stencil_test;
+}
+
void GPU_scissor_get(int coords[4])
{
GPUStateMutable &state = GPU_context_active_get()->state_manager->mutable_state;