st/mesa: don't generate NIR for ARB_vp/fp if NIR is not preferred
[mesa.git] / src / mesa / tnl / t_context.c
index b5c0b3e1f5b2f6c6f3a81795e66171f3b205d7dc..1b787180e3684c648ab1b4211ff9d7d4217daf44 100644 (file)
@@ -27,7 +27,7 @@
 
 
 #include "main/glheader.h"
-#include "main/imports.h"
+
 #include "main/context.h"
 #include "main/macros.h"
 #include "main/mtypes.h"
@@ -37,6 +37,7 @@
 #include "main/state.h"
 #include "main/viewport.h"
 #include "util/simple_list.h"
+#include "util/u_memory.h"
 
 #include "tnl.h"
 #include "t_context.h"
@@ -96,12 +97,12 @@ _tnl_CreateContext( struct gl_context *ctx )
       insert_at_tail( tnl->_ShineTabList, s );
    }
 
-   /* plug in the VBO drawing function */
-   vbo_set_draw_func(ctx, _tnl_draw_prims);
-
    _math_init_transformation();
    _math_init_translate();
 
+   /* Keep our list of tnl_vertex_array inputs */
+   _tnl_init_inputs(&tnl->draw_arrays);
+
    return GL_TRUE;
 }
 
@@ -131,8 +132,8 @@ void
 _tnl_InvalidateState( struct gl_context *ctx, GLuint new_state )
 {
    TNLcontext *tnl = TNL_CONTEXT(ctx);
-   const struct gl_vertex_program *vp = ctx->VertexProgram._Current;
-   const struct gl_fragment_program *fp = ctx->FragmentProgram._Current;
+   const struct gl_program *vp = ctx->VertexProgram._Current;
+   const struct gl_program *fp = ctx->FragmentProgram._Current;
    GLuint i;
 
    if (new_state & (_NEW_HINT | _NEW_PROGRAM)) {
@@ -148,7 +149,7 @@ _tnl_InvalidateState( struct gl_context *ctx, GLuint new_state )
     */
    tnl->render_inputs_bitset = BITFIELD64_BIT(_TNL_ATTRIB_POS);
 
-   if (!fp || (fp->Base.InputsRead & VARYING_BIT_COL0)) {
+   if (!fp || (fp->info.inputs_read & VARYING_BIT_COL0)) {
      tnl->render_inputs_bitset |= BITFIELD64_BIT(_TNL_ATTRIB_COLOR0);
    }
 
@@ -157,19 +158,20 @@ _tnl_InvalidateState( struct gl_context *ctx, GLuint new_state )
 
    for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) {
      if (ctx->Texture._EnabledCoordUnits & (1 << i) ||
-        (fp && fp->Base.InputsRead & VARYING_BIT_TEX(i))) {
+        (fp && fp->info.inputs_read & VARYING_BIT_TEX(i)) ||
+         _mesa_ati_fragment_shader_enabled(ctx)) {
        tnl->render_inputs_bitset |= BITFIELD64_BIT(_TNL_ATTRIB_TEX(i));
      }
    }
 
    if (ctx->Fog.Enabled
-       || (fp != NULL && (fp->Base.InputsRead & VARYING_BIT_FOGC) != 0)) {
+       || (fp != NULL && (fp->info.inputs_read & VARYING_BIT_FOGC) != 0)) {
       /* Either fixed-function fog or a fragment program needs fog coord.
        */
       tnl->render_inputs_bitset |= BITFIELD64_BIT(_TNL_ATTRIB_FOG);
    }
 
-   if (ctx->Polygon.FrontMode != GL_FILL || 
+   if (ctx->Polygon.FrontMode != GL_FILL ||
        ctx->Polygon.BackMode != GL_FILL)
       tnl->render_inputs_bitset |= BITFIELD64_BIT(_TNL_ATTRIB_EDGEFLAG);
 
@@ -183,7 +185,8 @@ _tnl_InvalidateState( struct gl_context *ctx, GLuint new_state )
    if (vp) {
       GLuint i;
       for (i = 0; i < MAX_VARYING; i++) {
-        if (vp->Base.OutputsWritten & BITFIELD64_BIT(VARYING_SLOT_VAR0 + i)) {
+        if (vp->info.outputs_written &
+             BITFIELD64_BIT(VARYING_SLOT_VAR0 + i)) {
             tnl->render_inputs_bitset |= BITFIELD64_BIT(_TNL_ATTRIB_GENERIC(i));
          }
       }
@@ -207,7 +210,7 @@ _tnl_wakeup( struct gl_context *ctx )
 
 #if 0
    if (ctx->Light.ColorMaterialEnabled) {
-      _mesa_update_color_material( ctx, 
+      _mesa_update_color_material( ctx,
                                   ctx->Current.Attrib[VERT_ATTRIB_COLOR0] );
    }
 #endif