mesa/vbo: add some missing fallthrough comments
[mesa.git] / src / mesa / state_tracker / st_atom_shader.c
index b18b33e50003bec2b0aab24bb5637f7ec6142711..b349c2a1f17eb637f300e254be86a9e44fcb14da 100644 (file)
@@ -1,8 +1,8 @@
 /**************************************************************************
- * 
+ *
  * Copyright 2003 VMware, Inc.
  * All Rights Reserved.
- * 
+ *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the
  * "Software"), to deal in the Software without restriction, including
  * distribute, sub license, and/or sell copies of the Software, and to
  * permit persons to whom the Software is furnished to do so, subject to
  * the following conditions:
- * 
+ *
  * The above copyright notice and this permission notice (including the
  * next paragraph) shall be included in all copies or substantial portions
  * of the Software.
- * 
+ *
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
@@ -22,7 +22,7 @@
  * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- * 
+ *
  **************************************************************************/
 
 /**
@@ -35,7 +35,7 @@
  *   Brian Paul
  */
 
-#include "main/imports.h"
+
 #include "main/mtypes.h"
 #include "main/framebuffer.h"
 #include "main/state.h"
@@ -109,10 +109,10 @@ st_update_fp( struct st_context *st )
    if (st->shader_has_one_variant[MESA_SHADER_FRAGMENT] &&
        !stfp->ati_fs && /* ATI_fragment_shader always has multiple variants */
        !stfp->Base.ExternalSamplersUsed && /* external samplers need variants */
-       stfp->fp_variants &&
-       !stfp->fp_variants->key.drawpixels &&
-       !stfp->fp_variants->key.bitmap) {
-      shader = stfp->fp_variants->driver_shader;
+       stfp->variants &&
+       !st_fp_variant(stfp->variants)->key.drawpixels &&
+       !st_fp_variant(stfp->variants)->key.bitmap) {
+      shader = stfp->variants->driver_shader;
    } else {
       struct st_fp_variant_key key;
 
@@ -133,7 +133,7 @@ st_update_fp( struct st_context *st )
       key.lower_two_sided_color = st->lower_two_sided_color &&
          _mesa_vertex_program_two_side_enabled(st->ctx);
 
-      /* _NEW_FRAG_CLAMP */
+      /* gl_driver_flags::NewFragClamp */
       key.clamp_color = st->clamp_frag_color_in_shader &&
                         st->ctx->Color._ClampFragmentColor;
 
@@ -160,7 +160,7 @@ st_update_fp( struct st_context *st )
 
       key.external = st_get_external_sampler_key(st, &stfp->Base);
 
-      shader = st_get_fp_variant(st, stfp, &key)->driver_shader;
+      shader = st_get_fp_variant(st, stfp, &key)->base.driver_shader;
    }
 
    st_reference_prog(st, &st->fp, stfp);
@@ -186,9 +186,10 @@ st_update_vp( struct st_context *st )
    assert(stvp->Base.Target == GL_VERTEX_PROGRAM_ARB);
 
    if (st->shader_has_one_variant[MESA_SHADER_VERTEX] &&
-       stvp->vp_variants &&
-       stvp->vp_variants->key.passthrough_edgeflags == st->vertdata_edgeflags) {
-      st->vp_variant = stvp->vp_variants;
+       stvp->variants &&
+       st_common_variant(stvp->variants)->key.passthrough_edgeflags == st->vertdata_edgeflags &&
+       !st_common_variant(stvp->variants)->key.is_draw_shader) {
+      st->vp_variant = st_common_variant(stvp->variants);
    } else {
       struct st_common_variant_key key;
 
@@ -235,8 +236,8 @@ st_update_vp( struct st_context *st )
 
    st_reference_prog(st, &st->vp, stvp);
 
-   cso_set_vertex_shader_handle(st->cso_context, 
-                                st->vp_variant->driver_shader);
+   cso_set_vertex_shader_handle(st->cso_context,
+                                st->vp_variant->base.driver_shader);
 }