i915_state_immediate.c File Reference

Include dependency graph for i915_state_immediate.c:

Go to the source code of this file.

Functions

static void upload_S0S1 (struct i915_context *i915)
static void upload_S2S4 (struct i915_context *i915)
static void upload_S5 (struct i915_context *i915)
static void upload_S6 (struct i915_context *i915)
static void upload_S7 (struct i915_context *i915)
void i915_update_immediate (struct i915_context *i915)

Variables

struct i915_tracked_state i915_upload_S0S1
struct i915_tracked_state i915_upload_S2S4
struct i915_tracked_state i915_upload_S5
struct i915_tracked_state i915_upload_S6
struct i915_tracked_state i915_upload_S7
static struct i915_tracked_stateatoms []


Function Documentation

void i915_update_immediate ( struct i915_context i915  ) 

Definition at line 218 of file i915_state_immediate.c.

References i915_tracked_state::dirty, i915_context::dirty, Elements, and i915_tracked_state::update.

00219 {
00220    int i;
00221 
00222    for (i = 0; i < Elements(atoms); i++)
00223       if (i915->dirty & atoms[i]->dirty)
00224          atoms[i]->update( i915 );
00225 }

static void upload_S0S1 ( struct i915_context i915  )  [static]

Definition at line 51 of file i915_state_immediate.c.

References i915_context::current, i915_context::hardware_dirty, I915_HW_IMMEDIATE, I915_IMMEDIATE_S0, I915_IMMEDIATE_S1, i915_state::immediate, vertex_info::size, i915_context::vbo_offset, and i915_state::vertex_info.

00052 {
00053    unsigned LIS0, LIS1;
00054 
00055    /* INTEL_NEW_VBO */
00056    /* TODO: re-use vertex buffers here? */
00057    LIS0 = i915->vbo_offset;
00058 
00059    /* INTEL_NEW_VERTEX_SIZE -- do this where the vertex size is calculated! 
00060     */
00061    {
00062       unsigned vertex_size = i915->current.vertex_info.size;
00063 
00064       LIS1 = ((vertex_size << 24) |
00065               (vertex_size << 16));
00066    }
00067 
00068    /* INTEL_NEW_VBO */
00069    /* TODO: use a vertex generation number to track vbo changes */
00070    if (1 ||
00071        i915->current.immediate[I915_IMMEDIATE_S0] != LIS0 ||
00072        i915->current.immediate[I915_IMMEDIATE_S1] != LIS1) 
00073    {
00074       i915->current.immediate[I915_IMMEDIATE_S0] = LIS0;
00075       i915->current.immediate[I915_IMMEDIATE_S1] = LIS1;
00076       i915->hardware_dirty |= I915_HW_IMMEDIATE;
00077    }
00078 }

static void upload_S2S4 ( struct i915_context i915  )  [static]

Definition at line 91 of file i915_state_immediate.c.

References assert, i915_context::current, i915_context::hardware_dirty, vertex_info::hwfmt, I915_HW_IMMEDIATE, I915_IMMEDIATE_S2, I915_IMMEDIATE_S4, i915_state::immediate, i915_rasterizer_state::LIS4, i915_context::rasterizer, and i915_state::vertex_info.

00092 {
00093    unsigned LIS2, LIS4;
00094 
00095    /* I915_NEW_VERTEX_FORMAT */
00096    {
00097       LIS2 = i915->current.vertex_info.hwfmt[1];
00098       LIS4 = i915->current.vertex_info.hwfmt[0];
00099       /*
00100       debug_printf("LIS2: 0x%x  LIS4: 0x%x\n", LIS2, LIS4);
00101       */
00102       assert(LIS4); /* should never be zero? */
00103    }
00104 
00105    LIS4 |= i915->rasterizer->LIS4;
00106 
00107    if (LIS2 != i915->current.immediate[I915_IMMEDIATE_S2] ||
00108        LIS4 != i915->current.immediate[I915_IMMEDIATE_S4]) {
00109 
00110       i915->current.immediate[I915_IMMEDIATE_S2] = LIS2;
00111       i915->current.immediate[I915_IMMEDIATE_S4] = LIS4;
00112       i915->hardware_dirty |= I915_HW_IMMEDIATE;
00113    }
00114 }

static void upload_S5 ( struct i915_context i915  )  [static]

Definition at line 127 of file i915_state_immediate.c.

References i915_context::blend, i915_context::current, i915_context::depth_stencil, i915_context::hardware_dirty, I915_HW_IMMEDIATE, I915_IMMEDIATE_S5, i915_state::immediate, i915_blend_state::LIS5, S5_GLOBAL_DEPTH_OFFSET_ENABLE, and i915_depth_stencil_state::stencil_LIS5.

00128 {
00129    unsigned LIS5 = 0;
00130 
00131    LIS5 |= i915->depth_stencil->stencil_LIS5;
00132 
00133    LIS5 |= i915->blend->LIS5;
00134 
00135 #if 0
00136    /* I915_NEW_RASTERIZER */
00137    if (i915->state.Polygon->OffsetFill) {
00138       LIS5 |= S5_GLOBAL_DEPTH_OFFSET_ENABLE;
00139    }
00140 #endif
00141 
00142 
00143    if (LIS5 != i915->current.immediate[I915_IMMEDIATE_S5]) {
00144       i915->current.immediate[I915_IMMEDIATE_S5] = LIS5;
00145       i915->hardware_dirty |= I915_HW_IMMEDIATE;
00146    }
00147 }

static void upload_S6 ( struct i915_context i915  )  [static]

Definition at line 157 of file i915_state_immediate.c.

References i915_context::blend, pipe_framebuffer_state::cbufs, i915_context::current, i915_depth_stencil_state::depth_LIS6, i915_context::depth_stencil, i915_context::framebuffer, i915_context::hardware_dirty, I915_HW_IMMEDIATE, I915_IMMEDIATE_S6, i915_state::immediate, i915_blend_state::LIS6, S6_COLOR_WRITE_ENABLE, and S6_TRISTRIP_PV_SHIFT.

00158 {
00159    unsigned LIS6 = (2 << S6_TRISTRIP_PV_SHIFT);
00160 
00161    /* I915_NEW_FRAMEBUFFER
00162     */
00163    if (i915->framebuffer.cbufs[0])
00164       LIS6 |= S6_COLOR_WRITE_ENABLE;
00165 
00166    /* I915_NEW_BLEND
00167     */
00168    LIS6 |= i915->blend->LIS6;
00169 
00170    /* I915_NEW_DEPTH
00171     */
00172    LIS6 |= i915->depth_stencil->depth_LIS6;
00173 
00174    if (LIS6 != i915->current.immediate[I915_IMMEDIATE_S6]) {
00175       i915->current.immediate[I915_IMMEDIATE_S6] = LIS6;
00176       i915->hardware_dirty |= I915_HW_IMMEDIATE;
00177    }
00178 }

static void upload_S7 ( struct i915_context i915  )  [static]

Definition at line 188 of file i915_state_immediate.c.

References i915_context::current, i915_context::hardware_dirty, I915_HW_IMMEDIATE, I915_IMMEDIATE_S7, i915_state::immediate, i915_rasterizer_state::LIS7, and i915_context::rasterizer.

00189 {
00190    unsigned LIS7;
00191 
00192    /* I915_NEW_RASTERIZER
00193     */
00194    LIS7 = i915->rasterizer->LIS7;
00195 
00196    if (LIS7 != i915->current.immediate[I915_IMMEDIATE_S7]) {
00197       i915->current.immediate[I915_IMMEDIATE_S7] = LIS7;
00198       i915->hardware_dirty |= I915_HW_IMMEDIATE;
00199    }
00200 }


Variable Documentation

struct i915_tracked_state* atoms[] [static]

Initial value:

Definition at line 208 of file i915_state_immediate.c.

struct i915_tracked_state i915_upload_S0S1

Initial value:

 {
    0x2000  |  0x10000 ,
   upload_S0S1
}

Definition at line 80 of file i915_state_immediate.c.

struct i915_tracked_state i915_upload_S2S4

Initial value:

 {
    0x2  |  0x10000 ,
   upload_S2S4
}

Definition at line 117 of file i915_state_immediate.c.

struct i915_tracked_state i915_upload_S5

Initial value:

 {
   ( 0x200  |  0x8  |  0x2 ),
   upload_S5
}

Definition at line 149 of file i915_state_immediate.c.

struct i915_tracked_state i915_upload_S6

Initial value:

 {
    0x8  |  0x200  |  0x80 ,
   upload_S6
}

Definition at line 180 of file i915_state_immediate.c.

struct i915_tracked_state i915_upload_S7

Initial value:

 {
    0x2 ,
   upload_S7
}

Definition at line 202 of file i915_state_immediate.c.


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