Merge commit 'origin/gallium-0.1' into gallium-0.2
authorJosé Fonseca <jfonseca@vmware.com>
Thu, 8 Jan 2009 12:31:14 +0000 (12:31 +0000)
committerJosé Fonseca <jfonseca@vmware.com>
Thu, 8 Jan 2009 12:31:14 +0000 (12:31 +0000)
Conflicts:

src/gallium/auxiliary/tgsi/tgsi_exec.c
src/gallium/drivers/cell/spu/spu_command.h
src/gallium/include/pipe/p_shader_tokens.h
src/mesa/main/config.h
src/mesa/main/mtypes.h
src/mesa/shader/prog_execute.c
src/mesa/shader/slang/slang_emit.c
src/mesa/state_tracker/st_program.c
src/mesa/state_tracker/wgl/stw_wgl.h
src/mesa/state_tracker/wgl/stw_wgl_pixelformat.h

src/gallium/auxiliary/draw/draw_pipe_validate.c
src/gallium/auxiliary/draw/draw_vbuf.h
src/gallium/auxiliary/tgsi/tgsi_dump.c
src/gallium/auxiliary/tgsi/tgsi_scan.c

index f34c68728ef1f4bf58bcccd6fd5a3ba45a0cd083..03e842ce082bc49a663f46289a917bcf04575b94 100644 (file)
@@ -33,6 +33,7 @@
 #include "draw_private.h"
 #include "draw_pipe.h"
 #include "draw_context.h"
+#include "draw_vbuf.h"
 
 static boolean points( unsigned prim )
 {
@@ -52,16 +53,28 @@ static boolean triangles( unsigned prim )
 }
 
 /**
- * Check if we need any special pipeline stages, or whether
- * prims/verts can go through untouched.  Don't test for bypass
- * clipping or vs modes, this function is just about the primitive
- * pipeline stages.
+ * Default version of a function to check if we need any special
+ * pipeline stages, or whether prims/verts can go through untouched.
+ * Don't test for bypass clipping or vs modes, this function is just
+ * about the primitive pipeline stages.
+ *
+ * This can be overridden by the driver.
  */
 boolean
 draw_need_pipeline(const struct draw_context *draw,
                    const struct pipe_rasterizer_state *rasterizer,
                    unsigned int prim )
 {
+   /* If the driver has overridden this, use that version: 
+    */
+   if (draw->render &&
+       draw->render->need_pipeline) 
+   {
+      return draw->render->need_pipeline( draw->render,
+                                          rasterizer,
+                                          prim );
+   }
+
    /* Don't have to worry about triangles turning into lines/points
     * and triggering the pipeline, because we have to trigger the
     * pipeline *anyway* if unfilled mode is active.
index b0aa2df309918cc887c74e074fac0c5202923cf4..9ac068c47b807d296e4fa29f079ea27c702c8705 100644 (file)
@@ -54,6 +54,17 @@ struct vbuf_render {
    unsigned max_indices;
    unsigned max_vertex_buffer_bytes;
 
+   /**
+    * Query if the hardware driver needs assistance for a particular
+    * combination of rasterizer state and primitive.
+    *
+    * Currently optional.
+    */
+   boolean (*need_pipeline)(const struct vbuf_render *render,
+                            const struct pipe_rasterizer_state *rasterizer,
+                            unsigned int prim );
+
+
    /**
     * Get the hardware vertex format.
     * 
index c2a0ac5aff848a7d38783787ba46dae1cfa33e04..2ed8c2bf07b3c8028fbf427a3337f5887964782b 100644 (file)
@@ -180,14 +180,16 @@ _dump_register_ind(
    uint file,
    int index,
    uint ind_file,
-   int ind_index )
+   int ind_index,
+   uint ind_swizzle )
 {
    ENM( file, file_names );
    CHR( '[' );
    ENM( ind_file, file_names );
    CHR( '[' );
    SID( ind_index );
-   CHR( ']' );
+   TXT( "]." );
+   ENM( ind_swizzle, swizzle_names );
    if (index != 0) {
       if (index > 0)
          CHR( '+' );
@@ -385,7 +387,8 @@ iter_instruction(
             src->SrcRegister.File,
             src->SrcRegister.Index,
             src->SrcRegisterInd.File,
-            src->SrcRegisterInd.Index );
+            src->SrcRegisterInd.Index,
+            src->SrcRegisterInd.SwizzleX );
       }
       else {
          _dump_register(
index cfc7ea8e898fb3e5988ebd330338530f3bb4231b..1239f6c07658df2cf530de558965f89fc7028688 100644 (file)
@@ -124,7 +124,7 @@ tgsi_scan_shader(const struct tgsi_token *tokens,
                /* only first 32 regs will appear in this bitfield */
                info->file_mask[file] |= (1 << reg);
                info->file_count[file]++;
-               info->file_max[file] = MAX2(info->file_max[file], (int)i);
+               info->file_max[file] = MAX2(info->file_max[file], (int)reg);
 
                if (file == TGSI_FILE_INPUT) {
                   info->input_semantic_name[reg] = (ubyte)fulldecl->Semantic.SemanticName;