i965: formatting, comments, whitespace clean-ups
authorBrian Paul <brianp@vmware.com>
Fri, 30 Jan 2009 16:50:26 +0000 (09:50 -0700)
committerBrian Paul <brianp@vmware.com>
Fri, 30 Jan 2009 23:03:32 +0000 (16:03 -0700)
src/mesa/drivers/dri/i965/brw_vtbl.c

index f7293ef4233d54c1ec21715f94e649243531397b..b4be1445581c28ead037153977fc1d7fc271be99 100644 (file)
  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  
- **********************************************************************/
- /*
-  * Authors:
-  *   Keith Whitwell <keith@tungstengraphics.com>
-  */
-            
-
+**********************************************************************/
 
+/*
+ * Authors:
+ *   Keith Whitwell <keith@tungstengraphics.com>
+ */
 
 #include "main/glheader.h"
 #include "main/mtypes.h"
 #include "brw_context.h"
 #include "brw_defines.h"
 #include "brw_state.h"
-
 #include "brw_draw.h"
 #include "brw_state.h"
 #include "brw_fallback.h"
 #include "brw_vs.h"
-#include <stdarg.h>
+
 
 static void
 dri_bo_release(dri_bo **bo)
@@ -58,7 +55,9 @@ dri_bo_release(dri_bo **bo)
    *bo = NULL;
 }
 
-/* called from intelDestroyContext()
+
+/**
+ * called from intelDestroyContext()
  */
 static void brw_destroy_context( struct intel_context *intel )
 {
@@ -72,7 +71,7 @@ static void brw_destroy_context( struct intel_context *intel )
    brw_FrameBufferTexDestroy( brw );
 
    for (i = 0; i < brw->state.nr_draw_regions; i++)
-       intel_region_release(&brw->state.draw_regions[i]);
+      intel_region_release(&brw->state.draw_regions[i]);
    brw->state.nr_draw_regions = 0;
    intel_region_release(&brw->state.depth_region);
 
@@ -99,37 +98,46 @@ static void brw_destroy_context( struct intel_context *intel )
    dri_bo_release(&brw->cc.vp_bo);
 }
 
-/* called from intelDrawBuffer()
+
+/**
+ * called from intelDrawBuffer()
  */
 static void brw_set_draw_region( struct intel_context *intel, 
-                                 struct intel_region *draw_regions[],
-                                 struct intel_region *depth_region,
-                               GLuint num_regions)
+                                 struct intel_region *draw_regions[],
+                                 struct intel_region *depth_region,
+                                 GLuint num_regions)
 {
    struct brw_context *brw = brw_context(&intel->ctx);
    int i;
+
+   /* release old color/depth regions */
    if (brw->state.depth_region != depth_region)
       brw->state.dirty.brw |= BRW_NEW_DEPTH_BUFFER;
    for (i = 0; i < brw->state.nr_draw_regions; i++)
        intel_region_release(&brw->state.draw_regions[i]);
    intel_region_release(&brw->state.depth_region);
+
+   /* reference new color/depth regions */
    for (i = 0; i < num_regions; i++)
        intel_region_reference(&brw->state.draw_regions[i], draw_regions[i]);
    intel_region_reference(&brw->state.depth_region, depth_region);
    brw->state.nr_draw_regions = num_regions;
 }
 
-/* called from intel_batchbuffer_flush and children before sending a
+
+/**
+ * called from intel_batchbuffer_flush and children before sending a
  * batchbuffer off.
  */
 static void brw_finish_batch(struct intel_context *intel)
 {
    struct brw_context *brw = brw_context(&intel->ctx);
-
    brw_emit_query_end(brw);
 }
 
-/* called from intelFlushBatchLocked
+
+/**
+ * called from intelFlushBatchLocked
  */
 static void brw_new_batch( struct intel_context *intel )
 {
@@ -160,22 +168,21 @@ static void brw_new_batch( struct intel_context *intel )
    }
 }
 
-static void brw_note_fence( struct intel_context *intel, 
-                           GLuint fence )
+
+static void brw_note_fence( struct intel_context *intel, GLuint fence )
 {
    brw_context(&intel->ctx)->state.dirty.brw |= BRW_NEW_FENCE;
 }
+
+
 static void brw_note_unlock( struct intel_context *intel )
 {
    struct brw_context *brw = brw_context(&intel->ctx);
-
    brw_state_cache_check_size(brw);
 }
 
 
-void brw_do_flush( struct brw_context *brw, 
-                  GLuint flags )
+void brw_do_flush( struct brw_context *brw, GLuint flags )
 {
    struct brw_mi_flush flush;
    memset(&flush, 0, sizeof(flush));      
@@ -185,8 +192,7 @@ void brw_do_flush( struct brw_context *brw,
 }
 
 
-static void brw_emit_flush( struct intel_context *intel,
-                       GLuint unused )
+static void brw_emit_flush( struct intel_context *intel, GLuint unused )
 {
    brw_do_flush(brw_context(&intel->ctx),
                BRW_FLUSH_STATE_CACHE|BRW_FLUSH_READ_CACHE);
@@ -206,6 +212,7 @@ static GLuint brw_flush_cmd( void )
    return *(GLuint *)&flush;
 }
 
+
 static void brw_invalidate_state( struct intel_context *intel, GLuint new_state )
 {
    /* nothing */
@@ -215,14 +222,14 @@ static void brw_invalidate_state( struct intel_context *intel, GLuint new_state
 void brwInitVtbl( struct brw_context *brw )
 {
    brw->intel.vtbl.check_vertex_size = 0;
-   brw->intel.vtbl.emit_state = 0; 
-   brw->intel.vtbl.reduced_primitive_state = 0;        
+   brw->intel.vtbl.emit_state = 0;
+   brw->intel.vtbl.reduced_primitive_state = 0;
    brw->intel.vtbl.render_start = 0;
-   brw->intel.vtbl.update_texture_state = 0; 
+   brw->intel.vtbl.update_texture_state = 0;
 
-   brw->intel.vtbl.invalidate_state = brw_invalidate_state; 
-   brw->intel.vtbl.note_fence = brw_note_fence; 
-   brw->intel.vtbl.note_unlock = brw_note_unlock; 
+   brw->intel.vtbl.invalidate_state = brw_invalidate_state;
+   brw->intel.vtbl.note_fence = brw_note_fence;
+   brw->intel.vtbl.note_unlock = brw_note_unlock;
    brw->intel.vtbl.new_batch = brw_new_batch;
    brw->intel.vtbl.finish_batch = brw_finish_batch;
    brw->intel.vtbl.destroy = brw_destroy_context;
@@ -231,4 +238,3 @@ void brwInitVtbl( struct brw_context *brw )
    brw->intel.vtbl.emit_flush = brw_emit_flush;
    brw->intel.vtbl.debug_batch = brw_debug_batch;
 }
-