diff options
author | Samuel Pitoiset <[email protected]> | 2017-07-17 21:52:55 +0200 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2017-07-31 13:53:39 +0200 |
commit | 999f2de9a860ff932899cf9982715d3bdd3d0ecf (patch) | |
tree | de7d0519920bab3a9e0672dbefa4f7970617ad2f /src/mesa/main/viewport.c | |
parent | 1bf703e4ea5c4f742bc7ba55d01e5afc3f4e11f9 (diff) |
mesa: add depth_range_arrayv() helper
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/mesa/main/viewport.c')
-rw-r--r-- | src/mesa/main/viewport.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/mesa/main/viewport.c b/src/mesa/main/viewport.c index cf2ace0b497..e1ab03dec39 100644 --- a/src/mesa/main/viewport.c +++ b/src/mesa/main/viewport.c @@ -359,10 +359,20 @@ _mesa_DepthRangef(GLclampf nearval, GLclampf farval) * \param v pointer to memory containing * GLclampd near and far clip-plane values */ +static ALWAYS_INLINE void +depth_range_arrayv(struct gl_context *ctx, GLuint first, GLsizei count, + const struct gl_depthrange_inputs *const inputs) +{ + for (GLsizei i = 0; i < count; i++) + set_depth_range_no_notify(ctx, i + first, inputs[i].Near, inputs[i].Far); + + if (ctx->Driver.DepthRange) + ctx->Driver.DepthRange(ctx); +} + void GLAPIENTRY _mesa_DepthRangeArrayv(GLuint first, GLsizei count, const GLclampd *v) { - int i; const struct gl_depthrange_inputs *const p = (struct gl_depthrange_inputs *) v; GET_CURRENT_CONTEXT(ctx); @@ -377,11 +387,7 @@ _mesa_DepthRangeArrayv(GLuint first, GLsizei count, const GLclampd *v) return; } - for (i = 0; i < count; i++) - set_depth_range_no_notify(ctx, i + first, p[i].Near, p[i].Far); - - if (ctx->Driver.DepthRange) - ctx->Driver.DepthRange(ctx); + depth_range_arrayv(ctx, first, count, p); } void GLAPIENTRY |