mesa: check constant before null check
For most drivers this if statement is always going to fail so check the constant value first. Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au> Reviewed-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
parent
b81de5352d
commit
5a40a00089
|
@ -581,9 +581,9 @@ vbo_handle_primitive_restart(struct gl_context *ctx,
|
||||||
{
|
{
|
||||||
struct vbo_context *vbo = vbo_context(ctx);
|
struct vbo_context *vbo = vbo_context(ctx);
|
||||||
|
|
||||||
if ((ib != NULL) &&
|
if (ctx->Const.PrimitiveRestartInSoftware &&
|
||||||
ctx->Const.PrimitiveRestartInSoftware &&
|
ctx->Array._PrimitiveRestart &&
|
||||||
ctx->Array._PrimitiveRestart) {
|
(ib != NULL)) {
|
||||||
/* Handle primitive restart in software */
|
/* Handle primitive restart in software */
|
||||||
vbo_sw_primitive_restart(ctx, prim, nr_prims, ib, NULL);
|
vbo_sw_primitive_restart(ctx, prim, nr_prims, ib, NULL);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue