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:
authorCampbell Barton <ideasman42@gmail.com>2017-06-19 13:18:04 +0300
committerCampbell Barton <ideasman42@gmail.com>2017-06-19 13:18:04 +0300
commitb4d053efc75424fca4b413ac1bc7a7e826fac629 (patch)
tree80647d9ca9109e997fce9911f202f98d7f8577d4 /source/blender/gpu/intern/gpu_draw.c
parent349946bd010b1112b13c8594aabfb318c330bc0d (diff)
Gawain API naming refactor
Use consistent prefix for gawain API names as well as some abbreviations to avoid over-long names, see: D2678
Diffstat (limited to 'source/blender/gpu/intern/gpu_draw.c')
-rw-r--r--source/blender/gpu/intern/gpu_draw.c100
1 files changed, 50 insertions, 50 deletions
diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c
index 529727b5e17..9ed6f387e90 100644
--- a/source/blender/gpu/intern/gpu_draw.c
+++ b/source/blender/gpu/intern/gpu_draw.c
@@ -2369,7 +2369,7 @@ static GPUAttribStack state = {
};
#define AttribStack state
-#define Attrib state.attrib_stack[state.top]
+#define Gwn_VertAttr state.attrib_stack[state.top]
/**
* Replacement for glPush/PopAttributes
@@ -2379,48 +2379,48 @@ static GPUAttribStack state = {
*/
void gpuPushAttrib(eGPUAttribMask mask)
{
- Attrib.mask = mask;
+ Gwn_VertAttr.mask = mask;
if ((mask & GPU_DEPTH_BUFFER_BIT) != 0) {
- Attrib.is_depth_test = glIsEnabled(GL_DEPTH_TEST);
- glGetIntegerv(GL_DEPTH_FUNC, &Attrib.depth_func);
- glGetDoublev(GL_DEPTH_CLEAR_VALUE, &Attrib.depth_clear_value);
- glGetBooleanv(GL_DEPTH_WRITEMASK, (GLboolean *)&Attrib.depth_write_mask);
+ Gwn_VertAttr.is_depth_test = glIsEnabled(GL_DEPTH_TEST);
+ glGetIntegerv(GL_DEPTH_FUNC, &Gwn_VertAttr.depth_func);
+ glGetDoublev(GL_DEPTH_CLEAR_VALUE, &Gwn_VertAttr.depth_clear_value);
+ glGetBooleanv(GL_DEPTH_WRITEMASK, (GLboolean *)&Gwn_VertAttr.depth_write_mask);
}
if ((mask & GPU_ENABLE_BIT) != 0) {
- Attrib.is_blend = glIsEnabled(GL_BLEND);
+ Gwn_VertAttr.is_blend = glIsEnabled(GL_BLEND);
for (int i = 0; i < 6; i++) {
- Attrib.is_clip_plane[i] = glIsEnabled(GL_CLIP_PLANE0 + i);
+ Gwn_VertAttr.is_clip_plane[i] = glIsEnabled(GL_CLIP_PLANE0 + i);
}
- Attrib.is_cull_face = glIsEnabled(GL_CULL_FACE);
- Attrib.is_depth_test = glIsEnabled(GL_DEPTH_TEST);
- Attrib.is_dither = glIsEnabled(GL_DITHER);
- Attrib.is_line_smooth = glIsEnabled(GL_LINE_SMOOTH);
- Attrib.is_color_logic_op = glIsEnabled(GL_COLOR_LOGIC_OP);
- Attrib.is_multisample = glIsEnabled(GL_MULTISAMPLE);
- Attrib.is_polygon_offset_line = glIsEnabled(GL_POLYGON_OFFSET_LINE);
- Attrib.is_polygon_offset_fill = glIsEnabled(GL_POLYGON_OFFSET_FILL);
- Attrib.is_polygon_smooth = glIsEnabled(GL_POLYGON_SMOOTH);
- Attrib.is_sample_alpha_to_coverage = glIsEnabled(GL_SAMPLE_ALPHA_TO_COVERAGE);
- Attrib.is_scissor_test = glIsEnabled(GL_SCISSOR_TEST);
- Attrib.is_stencil_test = glIsEnabled(GL_STENCIL_TEST);
+ Gwn_VertAttr.is_cull_face = glIsEnabled(GL_CULL_FACE);
+ Gwn_VertAttr.is_depth_test = glIsEnabled(GL_DEPTH_TEST);
+ Gwn_VertAttr.is_dither = glIsEnabled(GL_DITHER);
+ Gwn_VertAttr.is_line_smooth = glIsEnabled(GL_LINE_SMOOTH);
+ Gwn_VertAttr.is_color_logic_op = glIsEnabled(GL_COLOR_LOGIC_OP);
+ Gwn_VertAttr.is_multisample = glIsEnabled(GL_MULTISAMPLE);
+ Gwn_VertAttr.is_polygon_offset_line = glIsEnabled(GL_POLYGON_OFFSET_LINE);
+ Gwn_VertAttr.is_polygon_offset_fill = glIsEnabled(GL_POLYGON_OFFSET_FILL);
+ Gwn_VertAttr.is_polygon_smooth = glIsEnabled(GL_POLYGON_SMOOTH);
+ Gwn_VertAttr.is_sample_alpha_to_coverage = glIsEnabled(GL_SAMPLE_ALPHA_TO_COVERAGE);
+ Gwn_VertAttr.is_scissor_test = glIsEnabled(GL_SCISSOR_TEST);
+ Gwn_VertAttr.is_stencil_test = glIsEnabled(GL_STENCIL_TEST);
}
if ((mask & GPU_SCISSOR_BIT) != 0) {
- Attrib.is_scissor_test = glIsEnabled(GL_SCISSOR_TEST);
- glGetIntegerv(GL_SCISSOR_BOX, (GLint *)&Attrib.scissor_box);
+ Gwn_VertAttr.is_scissor_test = glIsEnabled(GL_SCISSOR_TEST);
+ glGetIntegerv(GL_SCISSOR_BOX, (GLint *)&Gwn_VertAttr.scissor_box);
}
if ((mask & GPU_VIEWPORT_BIT) != 0) {
- glGetDoublev(GL_DEPTH_RANGE, (GLdouble *)&Attrib.near_far);
- glGetIntegerv(GL_VIEWPORT, (GLint *)&Attrib.viewport);
+ glGetDoublev(GL_DEPTH_RANGE, (GLdouble *)&Gwn_VertAttr.near_far);
+ glGetIntegerv(GL_VIEWPORT, (GLint *)&Gwn_VertAttr.viewport);
}
if ((mask & GPU_BLEND_BIT) != 0) {
- Attrib.is_blend = glIsEnabled(GL_BLEND);
+ Gwn_VertAttr.is_blend = glIsEnabled(GL_BLEND);
}
BLI_assert(AttribStack.top < STATE_STACK_DEPTH);
@@ -2441,52 +2441,52 @@ void gpuPopAttrib(void)
BLI_assert(AttribStack.top > 0);
AttribStack.top--;
- GLint mask = Attrib.mask;
+ GLint mask = Gwn_VertAttr.mask;
if ((mask & GPU_DEPTH_BUFFER_BIT) != 0) {
- restore_mask(GL_DEPTH_TEST, Attrib.is_depth_test);
- glDepthFunc(Attrib.depth_func);
- glClearDepth(Attrib.depth_clear_value);
- glDepthMask(Attrib.depth_write_mask);
+ restore_mask(GL_DEPTH_TEST, Gwn_VertAttr.is_depth_test);
+ glDepthFunc(Gwn_VertAttr.depth_func);
+ glClearDepth(Gwn_VertAttr.depth_clear_value);
+ glDepthMask(Gwn_VertAttr.depth_write_mask);
}
if ((mask & GPU_ENABLE_BIT) != 0) {
- restore_mask(GL_BLEND, Attrib.is_blend);
+ restore_mask(GL_BLEND, Gwn_VertAttr.is_blend);
for (int i = 0; i < 6; i++) {
- restore_mask(GL_CLIP_PLANE0 + i, Attrib.is_clip_plane[i]);
+ restore_mask(GL_CLIP_PLANE0 + i, Gwn_VertAttr.is_clip_plane[i]);
}
- restore_mask(GL_CULL_FACE, Attrib.is_cull_face);
- restore_mask(GL_DEPTH_TEST, Attrib.is_depth_test);
- restore_mask(GL_DITHER, Attrib.is_dither);
- restore_mask(GL_LINE_SMOOTH, Attrib.is_line_smooth);
- restore_mask(GL_COLOR_LOGIC_OP, Attrib.is_color_logic_op);
- restore_mask(GL_MULTISAMPLE, Attrib.is_multisample);
- restore_mask(GL_POLYGON_OFFSET_LINE, Attrib.is_polygon_offset_line);
- restore_mask(GL_POLYGON_OFFSET_FILL, Attrib.is_polygon_offset_fill);
- restore_mask(GL_POLYGON_SMOOTH, Attrib.is_polygon_smooth);
- restore_mask(GL_SAMPLE_ALPHA_TO_COVERAGE, Attrib.is_sample_alpha_to_coverage);
- restore_mask(GL_SCISSOR_TEST, Attrib.is_scissor_test);
- restore_mask(GL_STENCIL_TEST, Attrib.is_stencil_test);
+ restore_mask(GL_CULL_FACE, Gwn_VertAttr.is_cull_face);
+ restore_mask(GL_DEPTH_TEST, Gwn_VertAttr.is_depth_test);
+ restore_mask(GL_DITHER, Gwn_VertAttr.is_dither);
+ restore_mask(GL_LINE_SMOOTH, Gwn_VertAttr.is_line_smooth);
+ restore_mask(GL_COLOR_LOGIC_OP, Gwn_VertAttr.is_color_logic_op);
+ restore_mask(GL_MULTISAMPLE, Gwn_VertAttr.is_multisample);
+ restore_mask(GL_POLYGON_OFFSET_LINE, Gwn_VertAttr.is_polygon_offset_line);
+ restore_mask(GL_POLYGON_OFFSET_FILL, Gwn_VertAttr.is_polygon_offset_fill);
+ restore_mask(GL_POLYGON_SMOOTH, Gwn_VertAttr.is_polygon_smooth);
+ restore_mask(GL_SAMPLE_ALPHA_TO_COVERAGE, Gwn_VertAttr.is_sample_alpha_to_coverage);
+ restore_mask(GL_SCISSOR_TEST, Gwn_VertAttr.is_scissor_test);
+ restore_mask(GL_STENCIL_TEST, Gwn_VertAttr.is_stencil_test);
}
if ((mask & GPU_VIEWPORT_BIT) != 0) {
- glViewport(Attrib.viewport[0], Attrib.viewport[1], Attrib.viewport[2], Attrib.viewport[3]);
- glDepthRange(Attrib.near_far[0], Attrib.near_far[1]);
+ glViewport(Gwn_VertAttr.viewport[0], Gwn_VertAttr.viewport[1], Gwn_VertAttr.viewport[2], Gwn_VertAttr.viewport[3]);
+ glDepthRange(Gwn_VertAttr.near_far[0], Gwn_VertAttr.near_far[1]);
}
if ((mask & GPU_SCISSOR_BIT) != 0) {
- restore_mask(GL_SCISSOR_TEST, Attrib.is_scissor_test);
- glScissor(Attrib.scissor_box[0], Attrib.scissor_box[1], Attrib.scissor_box[2], Attrib.scissor_box[3]);
+ restore_mask(GL_SCISSOR_TEST, Gwn_VertAttr.is_scissor_test);
+ glScissor(Gwn_VertAttr.scissor_box[0], Gwn_VertAttr.scissor_box[1], Gwn_VertAttr.scissor_box[2], Gwn_VertAttr.scissor_box[3]);
}
if ((mask & GPU_BLEND_BIT) != 0) {
- restore_mask(GL_BLEND, Attrib.is_blend);
+ restore_mask(GL_BLEND, Gwn_VertAttr.is_blend);
}
}
-#undef Attrib
+#undef Gwn_VertAttr
#undef AttribStack
/** \} */