brw_clip_state.c File Reference

Include dependency graph for brw_clip_state.c:

Go to the source code of this file.

Functions

static void upload_clip_unit (struct brw_context *brw)

Variables

struct brw_tracked_state brw_clip_unit


Function Documentation

static void upload_clip_unit ( struct brw_context brw  )  [static]

Definition at line 39 of file brw_clip_state.c.

References align(), brw_clip_unit_state::api_mode, brw_cache_data(), BRW_CLIP_API_OGL, BRW_CLIP_NDCSPACE, BRW_CLIP_UNIT, BRW_DEBUG, BRW_FLOATING_POINT_NON_IEEE_754, brw_context::cache, brw_context::clip, brw_clip_unit_state::clip5, brw_clip_unit_state::clip6, brw_clip_unit_state::clip_mode, brw_context::clip_start, brw_clip_unit_state::clipper_viewport_state_ptr, thread3::const_urb_entry_read_length, thread3::const_urb_entry_read_offset, brw_vs_prog_data::curb_read_length, brw_context::curbe, DEBUG_STATS, thread3::dispatch_grf_start_reg, brw_clip_unit_state::floating_point_mode, thread0::grf_reg_count, brw_clip_unit_state::guard_band_enable, thread0::kernel_start_pointer, brw_clip_unit_state::max_threads, brw_context::nr_clip_entries, brw_clip_unit_state::nr_urb_entries, brw_context::prog_data, brw_context::prog_gs_offset, brw_clip_unit_state::single_program_flow, brw_context::state_gs_offset, brw_clip_unit_state::stats_enable, brw_clip_unit_state::thread0, brw_clip_unit_state::thread1, brw_clip_unit_state::thread3, brw_clip_unit_state::thread4, brw_vs_prog_data::total_grf, brw_context::urb, brw_clip_unit_state::urb_entry_allocation_size, thread3::urb_entry_read_length, thread3::urb_entry_read_offset, brw_vs_prog_data::urb_read_length, brw_clip_unit_state::userclip_enable_flags, brw_clip_unit_state::userclip_must_clip, brw_clip_unit_state::vertex_position_space, brw_clip_unit_state::viewport_xmax, brw_clip_unit_state::viewport_xmin, brw_clip_unit_state::viewport_xy_clip_enable, brw_clip_unit_state::viewport_ymax, brw_clip_unit_state::viewport_ymin, brw_clip_unit_state::viewport_z_clip_enable, and brw_context::vsize.

00040 {
00041    struct brw_clip_unit_state clip;
00042 
00043    memset(&clip, 0, sizeof(clip));
00044 
00045    /* CACHE_NEW_CLIP_PROG */
00046    clip.thread0.grf_reg_count =
00047       align(brw->clip.prog_data->total_grf, 16) / 16 - 1;
00048    clip.thread0.kernel_start_pointer = brw->clip.prog_gs_offset >> 6;
00049    clip.thread3.urb_entry_read_length = brw->clip.prog_data->urb_read_length;
00050    clip.thread3.const_urb_entry_read_length = brw->clip.prog_data->curb_read_length;
00051    clip.clip5.clip_mode = brw->clip.prog_data->clip_mode;
00052 
00053    /* BRW_NEW_CURBE_OFFSETS */
00054    clip.thread3.const_urb_entry_read_offset = brw->curbe.clip_start * 2;
00055 
00056    /* BRW_NEW_URB_FENCE */
00057    clip.thread4.nr_urb_entries = brw->urb.nr_clip_entries; 
00058    clip.thread4.urb_entry_allocation_size = brw->urb.vsize - 1;
00059    clip.thread4.max_threads = 1; /* 2 threads */
00060 
00061    if (BRW_DEBUG & DEBUG_STATS)
00062       clip.thread4.stats_enable = 1; 
00063 
00064    /* CONSTANT */
00065    clip.thread1.floating_point_mode = BRW_FLOATING_POINT_NON_IEEE_754;
00066    clip.thread1.single_program_flow = 1;
00067    clip.thread3.dispatch_grf_start_reg = 1;
00068    clip.thread3.urb_entry_read_offset = 0;
00069    clip.clip5.userclip_enable_flags = 0x7f;
00070    clip.clip5.userclip_must_clip = 1;
00071    clip.clip5.guard_band_enable = 0;
00072    clip.clip5.viewport_z_clip_enable = 1;
00073    clip.clip5.viewport_xy_clip_enable = 1;
00074    clip.clip5.vertex_position_space = BRW_CLIP_NDCSPACE;
00075    clip.clip5.api_mode = BRW_CLIP_API_OGL;   
00076    clip.clip6.clipper_viewport_state_ptr = 0;
00077    clip.viewport_xmin = -1;
00078    clip.viewport_xmax = 1;
00079    clip.viewport_ymin = -1;
00080    clip.viewport_ymax = 1;
00081 
00082    brw->clip.state_gs_offset = brw_cache_data( &brw->cache[BRW_CLIP_UNIT], &clip );
00083 }


Variable Documentation

struct brw_tracked_state brw_clip_unit

Initial value:

 {
   .dirty = {
      .brw   = ( 0x40000  |
                 0x10000 ),
      .cache =  (1<<BRW_CLIP_PROG) 
   },
   .update = upload_clip_unit
}

Definition at line 86 of file brw_clip_state.c.


Generated on Tue Sep 29 06:25:36 2009 for Gallium3D by  doxygen 1.5.4