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:
authorDalai Felinto <dfelinto@gmail.com>2017-05-09 16:09:39 +0300
committerDalai Felinto <dfelinto@gmail.com>2017-05-09 16:23:33 +0300
commit65ebb668ec8d1fed282d59eea47da6dd47b699db (patch)
tree69fd13e5ae63bfd400112c8b954b586c8a5ae496 /source/blender/gpu/GPU_draw.h
parent86c299c6a48036258096eb0c3447cad86369d4de (diff)
glPushAttrib/Pop change implementation to use a stack
The original implementation (cbd78c81268f) broke depth of field.
Diffstat (limited to 'source/blender/gpu/GPU_draw.h')
-rw-r--r--source/blender/gpu/GPU_draw.h50
1 files changed, 4 insertions, 46 deletions
diff --git a/source/blender/gpu/GPU_draw.h b/source/blender/gpu/GPU_draw.h
index cd305d5697f..52076c307df 100644
--- a/source/blender/gpu/GPU_draw.h
+++ b/source/blender/gpu/GPU_draw.h
@@ -174,58 +174,16 @@ void GPU_select_index_get(int index, int *r_col);
int GPU_select_to_index(unsigned int col);
void GPU_select_to_index_array(unsigned int *col, const unsigned int size);
-typedef enum eGPUStateMask {
+typedef enum eGPUAttribMask {
GPU_DEPTH_BUFFER_BIT = (1 << 0),
GPU_ENABLE_BIT = (1 << 1),
GPU_SCISSOR_BIT = (1 << 2),
GPU_VIEWPORT_BIT = (1 << 3),
GPU_BLEND_BIT = (1 << 4),
-} eGPUStateMask;
-
-typedef struct GPUStateValues
-{
- eGPUStateMask mask;
-
- /* GL_ENABLE_BIT */
- unsigned int is_blend : 1;
- unsigned int is_cull_face : 1;
- unsigned int is_depth_test : 1;
- unsigned int is_dither : 1;
- unsigned int is_lighting : 1;
- unsigned int is_line_smooth : 1;
- unsigned int is_color_logic_op : 1;
- unsigned int is_multisample : 1;
- unsigned int is_polygon_offset_line : 1;
- unsigned int is_polygon_offset_fill : 1;
- unsigned int is_polygon_smooth : 1;
- unsigned int is_sample_alpha_to_coverage : 1;
- unsigned int is_scissor_test : 1;
- unsigned int is_stencil_test : 1;
-
-#ifdef WITH_LEGACY_OPENGL
- unsigned int is_alpha_test : 1;
- bool is_light[8];
-#endif
-
- bool is_clip_plane[6];
-
- /* GL_DEPTH_BUFFER_BIT */
- /* unsigned int is_depth_test : 1; */
- int depth_func;
- double depth_clear_value;
- bool depth_write_mask;
-
- /* GL_SCISSOR_BIT */
- int scissor_box[4];
- /* unsigned int is_scissor_test : 1; */
-
- /* GL_VIEWPORT_BIT */
- int viewport[4];
- double near_far[2];
-} GPUStateValues;
+} eGPUAttribMask;
-void gpuSaveState(GPUStateValues *attribs, eGPUStateMask mask);
-void gpuRestoreState(GPUStateValues *attribs);
+void gpuPushAttrib(eGPUAttribMask mask);
+void gpuPopAttrib(void);
#ifdef __cplusplus
}