mesa: add depth_range_arrayv() helper
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
This commit is contained in:
parent
1bf703e4ea
commit
999f2de9a8
|
@ -359,10 +359,20 @@ _mesa_DepthRangef(GLclampf nearval, GLclampf farval)
|
||||||
* \param v pointer to memory containing
|
* \param v pointer to memory containing
|
||||||
* GLclampd near and far clip-plane values
|
* 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
|
void GLAPIENTRY
|
||||||
_mesa_DepthRangeArrayv(GLuint first, GLsizei count, const GLclampd *v)
|
_mesa_DepthRangeArrayv(GLuint first, GLsizei count, const GLclampd *v)
|
||||||
{
|
{
|
||||||
int i;
|
|
||||||
const struct gl_depthrange_inputs *const p =
|
const struct gl_depthrange_inputs *const p =
|
||||||
(struct gl_depthrange_inputs *) v;
|
(struct gl_depthrange_inputs *) v;
|
||||||
GET_CURRENT_CONTEXT(ctx);
|
GET_CURRENT_CONTEXT(ctx);
|
||||||
|
@ -377,11 +387,7 @@ _mesa_DepthRangeArrayv(GLuint first, GLsizei count, const GLclampd *v)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < count; i++)
|
depth_range_arrayv(ctx, first, count, p);
|
||||||
set_depth_range_no_notify(ctx, i + first, p[i].Near, p[i].Far);
|
|
||||||
|
|
||||||
if (ctx->Driver.DepthRange)
|
|
||||||
ctx->Driver.DepthRange(ctx);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GLAPIENTRY
|
void GLAPIENTRY
|
||||||
|
|
Loading…
Reference in New Issue