Squashed commit of the following:
[mesa.git] / src / gallium / drivers / i965 / brw_pipe_shader.c
index 31a715ab6555e07404e0e1bc1e6f5868fb29d151..d9bee96c11f73ad2ed099e87b300f5df2eac5bd4 100644 (file)
   *   Keith Whitwell <keith@tungstengraphics.com>
   */
 
+#include "util/u_inlines.h"
 #include "util/u_memory.h"
   
 #include "tgsi/tgsi_parse.h"
 #include "tgsi/tgsi_scan.h"
 
 #include "brw_context.h"
-#include "brw_util.h"
 #include "brw_wm.h"
 
 
@@ -197,6 +197,13 @@ static void *brw_create_vs_state( struct pipe_context *pipe,
    vs->id = brw->program_id++;
    vs->has_flow_control = has_flow_control(&vs->info);
 
+   vs->output_hpos = BRW_OUTPUT_NOT_PRESENT;
+   vs->output_color0 = BRW_OUTPUT_NOT_PRESENT;
+   vs->output_color1 = BRW_OUTPUT_NOT_PRESENT;
+   vs->output_bfc0 = BRW_OUTPUT_NOT_PRESENT;
+   vs->output_bfc1 = BRW_OUTPUT_NOT_PRESENT;
+   vs->output_edgeflag = BRW_OUTPUT_NOT_PRESENT;
+
    for (i = 0; i < vs->info.num_outputs; i++) {
       int index = vs->info.output_semantic_index[i];
       switch (vs->info.output_semantic_name[i]) {
@@ -215,15 +222,12 @@ static void *brw_create_vs_state( struct pipe_context *pipe,
          else
             vs->output_bfc1 = i;
          break;
-#if 0
       case TGSI_SEMANTIC_EDGEFLAG:
          vs->output_edgeflag = i;
          break;
-#endif
       }
    }
 
-
    
    /* Done:
     */
@@ -258,21 +262,21 @@ static void brw_delete_vs_state( struct pipe_context *pipe, void *prog )
 
 static void brw_set_constant_buffer(struct pipe_context *pipe,
                                      uint shader, uint index,
-                                     const struct pipe_constant_buffer *buf)
+                                     struct pipe_resource *buf)
 {
    struct brw_context *brw = brw_context(pipe);
 
    assert(index == 0);
 
    if (shader == PIPE_SHADER_FRAGMENT) {
-      pipe_buffer_reference( &brw->curr.fragment_constants,
-                             buf->buffer );
+      pipe_resource_reference( &brw->curr.fragment_constants,
+                             buf );
 
       brw->state.dirty.mesa |= PIPE_NEW_FRAGMENT_CONSTANTS;
    }
    else {
-      pipe_buffer_reference( &brw->curr.vertex_constants,
-                             buf->buffer );
+      pipe_resource_reference( &brw->curr.vertex_constants,
+                             buf );
 
       brw->state.dirty.mesa |= PIPE_NEW_VERTEX_CONSTANTS;
    }
@@ -294,6 +298,6 @@ void brw_pipe_shader_init( struct brw_context *brw )
 
 void brw_pipe_shader_cleanup( struct brw_context *brw )
 {
-   pipe_buffer_reference( &brw->curr.fragment_constants, NULL );
-   pipe_buffer_reference( &brw->curr.vertex_constants, NULL );
+   pipe_resource_reference( &brw->curr.fragment_constants, NULL );
+   pipe_resource_reference( &brw->curr.vertex_constants, NULL );
 }