OSDN Git Service

mesa: inline vbo_exec_invalidate_state() and call from mesa core
authorTimothy Arceri <tarceri@itsqueeze.com>
Wed, 7 Jun 2017 03:26:16 +0000 (13:26 +1000)
committerTimothy Arceri <tarceri@itsqueeze.com>
Thu, 8 Jun 2017 23:13:46 +0000 (09:13 +1000)
Rather than calling it indirectly in each driver.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
16 files changed:
src/mesa/drivers/dri/i915/i915_context.c
src/mesa/drivers/dri/i915/intel_context.c
src/mesa/drivers/dri/i965/brw_context.c
src/mesa/drivers/dri/nouveau/nouveau_state.c
src/mesa/drivers/dri/r200/r200_state.c
src/mesa/drivers/dri/radeon/radeon_state.c
src/mesa/drivers/dri/swrast/swrast.c
src/mesa/drivers/osmesa/osmesa.c
src/mesa/drivers/x11/xm_dd.c
src/mesa/main/state.c
src/mesa/state_tracker/st_context.c
src/mesa/vbo/vbo.h
src/mesa/vbo/vbo_context.c
src/mesa/vbo/vbo_context.h
src/mesa/vbo/vbo_exec.c
src/mesa/vbo/vbo_exec.h

index 1406b65..4d89af1 100644 (file)
@@ -58,7 +58,6 @@ i915InvalidateState(struct gl_context * ctx)
 
    _swrast_InvalidateState(ctx, new_state);
    _swsetup_InvalidateState(ctx, new_state);
-   _vbo_InvalidateState(ctx, new_state);
    _tnl_InvalidateState(ctx, new_state);
    _tnl_invalidate_vertex_state(ctx, new_state);
    intel_context(ctx)->NewGLState |= new_state;
index 6c59b42..7f39245 100644 (file)
@@ -321,7 +321,6 @@ intelInvalidateState(struct gl_context * ctx)
 
     if (ctx->swrast_context)
        _swrast_InvalidateState(ctx, new_state);
-   _vbo_InvalidateState(ctx, new_state);
 
    intel->NewGLState |= new_state;
 
index 8116645..6d27866 100644 (file)
@@ -196,7 +196,6 @@ intel_update_state(struct gl_context * ctx)
 
    if (ctx->swrast_context)
       _swrast_InvalidateState(ctx, new_state);
-   _vbo_InvalidateState(ctx, new_state);
 
    brw->NewGLState |= new_state;
 
index 567f32f..6d998fc 100644 (file)
@@ -494,7 +494,6 @@ nouveau_update_state(struct gl_context *ctx)
 
        _swrast_InvalidateState(ctx, new_state);
        _tnl_InvalidateState(ctx, new_state);
-       _vbo_InvalidateState(ctx, new_state);
 
        nouveau_state_emit(ctx);
 }
index d5a6f09..30437e3 100644 (file)
@@ -2284,7 +2284,6 @@ static void r200InvalidateState(struct gl_context *ctx)
 
    _swrast_InvalidateState( ctx, new_state );
    _swsetup_InvalidateState( ctx, new_state );
-   _vbo_InvalidateState( ctx, new_state );
    _tnl_InvalidateState( ctx, new_state );
    R200_CONTEXT(ctx)->radeon.NewGLState |= new_state;
 
index ff2a708..940f8de 100644 (file)
@@ -2050,7 +2050,6 @@ static void radeonInvalidateState(struct gl_context *ctx)
 
    _swrast_InvalidateState( ctx, new_state );
    _swsetup_InvalidateState( ctx, new_state );
-   _vbo_InvalidateState( ctx, new_state );
    _tnl_InvalidateState( ctx, new_state );
    R100_CONTEXT(ctx)->radeon.NewGLState |= new_state;
 }
index a68f7a0..3b1de42 100644 (file)
@@ -704,7 +704,6 @@ update_state(struct gl_context *ctx)
     /* not much to do here - pass it on */
     _swrast_InvalidateState( ctx, new_state );
     _swsetup_InvalidateState( ctx, new_state );
-    _vbo_InvalidateState( ctx, new_state );
     _tnl_InvalidateState( ctx, new_state );
 }
 
index ed69353..c77dcc4 100644 (file)
@@ -123,7 +123,6 @@ osmesa_update_state(struct gl_context *ctx, GLuint new_state)
    _swrast_InvalidateState( ctx, new_state );
    _swsetup_InvalidateState( ctx, new_state );
    _tnl_InvalidateState( ctx, new_state );
-   _vbo_InvalidateState( ctx, new_state );
 }
 
 static void
index e06831c..61aa6c8 100644 (file)
@@ -689,7 +689,6 @@ xmesa_update_state(struct gl_context *ctx)
     */
    _swrast_InvalidateState( ctx, new_state );
    _tnl_InvalidateState( ctx, new_state );
-   _vbo_InvalidateState( ctx, new_state );
    _swsetup_InvalidateState( ctx, new_state );
 
    if (_mesa_is_user_fbo(ctx->DrawBuffer))
index 04dafa9..b7e165f 100644 (file)
@@ -51,6 +51,7 @@
 #include "texobj.h"
 #include "texstate.h"
 #include "varray.h"
+#include "vbo/vbo_context.h"
 #include "viewport.h"
 #include "blend.h"
 
@@ -410,13 +411,15 @@ _mesa_update_state_locked( struct gl_context *ctx )
  out:
    new_prog_state |= update_program_constants(ctx);
 
+   ctx->NewState |= new_prog_state;
+   vbo_exec_invalidate_state(ctx);
+
    /*
     * Give the driver a chance to act upon the new_state flags.
     * The driver might plug in different span functions, for example.
     * Also, this is where the driver can invalidate the state of any
     * active modules (such as swrast_setup, swrast, tnl, etc).
     */
-   ctx->NewState |= new_prog_state;
    ctx->Driver.UpdateState(ctx);
    ctx->NewState = 0;
    ctx->Array.VAO->NewArrays = 0x0;
index 0e768ea..743c7bd 100644 (file)
@@ -279,11 +279,6 @@ st_invalidate_state(struct gl_context * ctx)
 
    if (new_state & _NEW_PROGRAM_CONSTANTS)
       st->dirty |= st->active_states & ST_NEW_CONSTANTS;
-
-   /* This is the only core Mesa module we depend upon.
-    * No longer use swrast, swsetup, tnl.
-    */
-   _vbo_InvalidateState(ctx, new_state);
 }
 
 
index 79f7538..eec484b 100644 (file)
@@ -78,7 +78,6 @@ struct _mesa_index_buffer {
 
 GLboolean _vbo_CreateContext( struct gl_context *ctx );
 void _vbo_DestroyContext( struct gl_context *ctx );
-void _vbo_InvalidateState( struct gl_context *ctx, GLbitfield new_state );
 
 
 void
index 384e405..a5f915d 100644 (file)
@@ -227,12 +227,6 @@ GLboolean _vbo_CreateContext( struct gl_context *ctx )
 }
 
 
-void _vbo_InvalidateState( struct gl_context *ctx, GLbitfield new_state )
-{
-   vbo_exec_invalidate_state(ctx, new_state);
-}
-
-
 void _vbo_DestroyContext( struct gl_context *ctx )
 {
    struct vbo_context *vbo = vbo_context(ctx);
index 5cf399f..0418643 100644 (file)
@@ -56,6 +56,7 @@
 #include "vbo_exec.h"
 #include "vbo_save.h"
 
+#include "main/api_arrayelt.h"
 #include "main/macros.h"
 
 #ifdef __cplusplus
@@ -91,6 +92,23 @@ static inline struct vbo_context *vbo_context(struct gl_context *ctx)
 }
 
 
+static inline void
+vbo_exec_invalidate_state(struct gl_context *ctx)
+{
+   struct vbo_context *vbo = vbo_context(ctx);
+   struct vbo_exec_context *exec = &vbo->exec;
+
+   if (!exec->validating && ctx->NewState & (_NEW_PROGRAM | _NEW_ARRAY)) {
+      exec->array.recalculate_inputs = GL_TRUE;
+   }
+
+   if (ctx->NewState & _NEW_EVAL)
+      exec->eval.recalculate_maps = GL_TRUE;
+
+   _ae_invalidate_state(ctx, ctx->NewState);
+}
+
+
 /**
  * Return VP_x token to indicate whether we're running fixed-function
  * vertex transformation, an NV vertex program or ARB vertex program/shader.
index de8461f..dc26dfd 100644 (file)
@@ -26,7 +26,6 @@
  */
 
 
-#include "main/api_arrayelt.h"
 #include "main/glheader.h"
 #include "main/mtypes.h"
 #include "main/vtxfmt.h"
@@ -71,27 +70,6 @@ void vbo_exec_destroy( struct gl_context *ctx )
 
 
 /**
- * Really want to install these callbacks to a central facility to be
- * invoked according to the state flags.  That will have to wait for a
- * mesa rework:
- */ 
-void vbo_exec_invalidate_state( struct gl_context *ctx, GLbitfield new_state )
-{
-   struct vbo_context *vbo = vbo_context(ctx);
-   struct vbo_exec_context *exec = &vbo->exec;
-
-   if (!exec->validating && new_state & (_NEW_PROGRAM|_NEW_ARRAY)) {
-      exec->array.recalculate_inputs = GL_TRUE;
-   }
-
-   if (new_state & _NEW_EVAL)
-      exec->eval.recalculate_maps = GL_TRUE;
-
-   _ae_invalidate_state(ctx, new_state);
-}
-
-
-/**
  * Figure out the number of transform feedback primitives that will be output
  * considering the drawing mode, number of vertices, and instance count,
  * assuming that no geometry shading is done and primitive restart is not
index 9358ca2..f1e3881 100644 (file)
@@ -147,7 +147,6 @@ struct vbo_exec_context
  */
 void vbo_exec_init( struct gl_context *ctx );
 void vbo_exec_destroy( struct gl_context *ctx );
-void vbo_exec_invalidate_state( struct gl_context *ctx, GLbitfield new_state );
 
 
 /* Internal functions: