st/mesa: only expose ARB_shader_bit_encoding with GLSL 1.3
[mesa.git] / src / mesa / state_tracker / st_program.c
index deee722cfa6514a3fd0a52636c1f5c31af2cfc9d..9f98298b4a099bd68cd111d05786427ec86dd7e2 100644 (file)
@@ -569,12 +569,12 @@ st_translate_fragment_program(struct st_context *st,
          case FRAG_ATTRIB_CLIP_DIST0:
             input_semantic_name[slot] = TGSI_SEMANTIC_CLIPDIST;
             input_semantic_index[slot] = 0;
-            interpMode[slot] = TGSI_INTERPOLATE_LINEAR;
+            interpMode[slot] = TGSI_INTERPOLATE_PERSPECTIVE;
             break;
          case FRAG_ATTRIB_CLIP_DIST1:
             input_semantic_name[slot] = TGSI_SEMANTIC_CLIPDIST;
             input_semantic_index[slot] = 1;
-            interpMode[slot] = TGSI_INTERPOLATE_LINEAR;
+            interpMode[slot] = TGSI_INTERPOLATE_PERSPECTIVE;
             break;
             /* In most cases, there is nothing special about these
              * inputs, so adopt a convention to use the generic
@@ -1285,3 +1285,26 @@ st_destroy_program_variants(struct st_context *st)
    _mesa_HashWalk(st->ctx->Shared->ShaderObjects,
                   destroy_shader_program_variants_cb, st);
 }
+
+
+/**
+ * For debugging, print/dump the current vertex program.
+ */
+void
+st_print_current_vertex_program(void)
+{
+   GET_CURRENT_CONTEXT(ctx);
+
+   if (ctx->VertexProgram._Current) {
+      struct st_vertex_program *stvp =
+         (struct st_vertex_program *) ctx->VertexProgram._Current;
+      struct st_vp_variant *stv;
+
+      debug_printf("Vertex program %u\n", stvp->Base.Base.Id);
+
+      for (stv = stvp->variants; stv; stv = stv->next) {
+         debug_printf("variant %p\n", stv);
+         tgsi_dump(stv->tgsi.tokens, 0);
+      }
+   }
+}