diff options
author | Brian Paul <[email protected]> | 2018-01-24 09:14:35 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2018-01-29 08:35:14 -0700 |
commit | 0d044f7d619c56c67d8235312363d93e2362248f (patch) | |
tree | 14c151223842438d386f5369075b007f44d4c377 /src/mesa/vbo/vbo_private.h | |
parent | d9894ede02d13735c62da3e0ace9e9c647e2956a (diff) |
mesa/vbo: replace vbo_draw_method() with _mesa_set_drawing_arrays()
The arrays specified by ctx->Array._DrawArrays are used for all
vertex drawing via vbo_context::draw_prims(). Different arrays are
used for immediate mode, vertex arrays, display lists, etc. Changing
from one to another requires updating derived/driver array state.
Before, we indirectly specifid the arrays with the gl_draw_method values.
Now we just directly specify the arrays instead. This is simpler and
will allow a subsequent display list optimization.
In the future, it might make sense to get rid of ctx->Array._DrawArrays
entirely and just pass the arrays as another parameter to
vbo_context::draw_prims().
Reviewed-by: Mathias Fröhlich <[email protected]>
Diffstat (limited to 'src/mesa/vbo/vbo_private.h')
-rw-r--r-- | src/mesa/vbo/vbo_private.h | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/src/mesa/vbo/vbo_private.h b/src/mesa/vbo/vbo_private.h index d78593c7fa2..7c1e3c481f1 100644 --- a/src/mesa/vbo/vbo_private.h +++ b/src/mesa/vbo/vbo_private.h @@ -99,43 +99,6 @@ get_vp_mode( struct gl_context *ctx ) /** - * This is called by glBegin, glDrawArrays and glDrawElements (and - * variations of those calls). When we transition from immediate mode - * drawing to array drawing we need to invalidate the array state. - * - * glBegin/End builds vertex arrays. Those arrays may look identical - * to glDrawArrays arrays except that the position of the elements may - * be different. For example, arrays of (position3v, normal3f) vs. arrays - * of (normal3f, position3f). So we need to make sure we notify drivers - * that arrays may be changing. - */ -static inline void -vbo_draw_method(struct vbo_context *vbo, gl_draw_method method) -{ - struct gl_context *ctx = vbo->exec.ctx; - - if (ctx->Array.DrawMethod != method) { - switch (method) { - case DRAW_ARRAYS: - ctx->Array._DrawArrays = vbo->exec.array.inputs; - break; - case DRAW_BEGIN_END: - ctx->Array._DrawArrays = vbo->exec.vtx.inputs; - break; - case DRAW_DISPLAY_LIST: - ctx->Array._DrawArrays = vbo->save.inputs; - break; - default: - unreachable("Bad VBO drawing method"); - } - - ctx->NewDriverState |= ctx->DriverFlags.NewArray; - ctx->Array.DrawMethod = method; - } -} - - -/** * Return if format is integer. The immediate mode commands only emit floats * for non-integer types, thus everything else is integer. */ |