i915_context.h File Reference

Include dependency graph for i915_context.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  i915_fragment_shader
 Subclass of pipe_shader_state. More...
struct  i915_state
struct  i915_blend_state
struct  i915_depth_stencil_state
struct  i915_rasterizer_state
struct  i915_sampler_state
struct  i915_texture
struct  i915_context

Defines

#define I915_TEX_UNITS   8
#define I915_DYNAMIC_MODES4   0
#define I915_DYNAMIC_DEPTHSCALE_0   1
#define I915_DYNAMIC_DEPTHSCALE_1   2
#define I915_DYNAMIC_IAB   3
#define I915_DYNAMIC_BC_0   4
#define I915_DYNAMIC_BC_1   5
#define I915_DYNAMIC_BFO_0   6
#define I915_DYNAMIC_BFO_1   7
#define I915_DYNAMIC_STP_0   8
#define I915_DYNAMIC_STP_1   9
#define I915_DYNAMIC_SC_ENA_0   10
#define I915_DYNAMIC_SC_RECT_0   11
#define I915_DYNAMIC_SC_RECT_1   12
#define I915_DYNAMIC_SC_RECT_2   13
#define I915_MAX_DYNAMIC   14
#define I915_IMMEDIATE_S0   0
#define I915_IMMEDIATE_S1   1
#define I915_IMMEDIATE_S2   2
#define I915_IMMEDIATE_S3   3
#define I915_IMMEDIATE_S4   4
#define I915_IMMEDIATE_S5   5
#define I915_IMMEDIATE_S6   6
#define I915_IMMEDIATE_S7   7
#define I915_MAX_IMMEDIATE   8
#define I915_CACHE_STATIC   0
#define I915_CACHE_DYNAMIC   1
#define I915_CACHE_SAMPLER   2
#define I915_CACHE_MAP   3
#define I915_CACHE_PROGRAM   4
#define I915_CACHE_CONSTANTS   5
#define I915_MAX_CACHE   6
#define I915_MAX_CONSTANT   32
#define I915_CONSTFLAG_USER   0x1f
 See constant_flags[] below.
#define I915_NEW_VIEWPORT   0x1
#define I915_NEW_RASTERIZER   0x2
#define I915_NEW_FS   0x4
#define I915_NEW_BLEND   0x8
#define I915_NEW_CLIP   0x10
#define I915_NEW_SCISSOR   0x20
#define I915_NEW_STIPPLE   0x40
#define I915_NEW_FRAMEBUFFER   0x80
#define I915_NEW_ALPHA_TEST   0x100
#define I915_NEW_DEPTH_STENCIL   0x200
#define I915_NEW_SAMPLER   0x400
#define I915_NEW_TEXTURE   0x800
#define I915_NEW_CONSTANTS   0x1000
#define I915_NEW_VBO   0x2000
#define I915_NEW_VS   0x4000
#define I915_NEW_VERTEX_FORMAT   0x10000
#define I915_HW_STATIC   (1<<I915_CACHE_STATIC)
#define I915_HW_DYNAMIC   (1<<I915_CACHE_DYNAMIC)
#define I915_HW_SAMPLER   (1<<I915_CACHE_SAMPLER)
#define I915_HW_MAP   (1<<I915_CACHE_MAP)
#define I915_HW_PROGRAM   (1<<I915_CACHE_PROGRAM)
#define I915_HW_CONSTANTS   (1<<I915_CACHE_CONSTANTS)
#define I915_HW_IMMEDIATE   (1<<(I915_MAX_CACHE+0))
#define I915_HW_INVARIENT   (1<<(I915_MAX_CACHE+1))

Functions

struct draw_stagei915_draw_render_stage (struct i915_context *i915)
 Create a new primitive setup/render stage.
struct draw_stagei915_draw_vbuf_stage (struct i915_context *i915)
 Create a new primitive vbuf/render stage.
void i915_emit_hardware_state (struct i915_context *i915)
void i915_clear (struct pipe_context *pipe, struct pipe_surface *ps, unsigned clearValue)
 Clear the given surface to the specified value.
void i915_init_surface_functions (struct i915_context *i915)
void i915_init_state_functions (struct i915_context *i915)
void i915_init_flush_functions (struct i915_context *i915)
void i915_init_string_functions (struct i915_context *i915)
static struct i915_contexti915_context (struct pipe_context *pipe)


Define Documentation

#define I915_CACHE_CONSTANTS   5

Definition at line 78 of file i915_context.h.

#define I915_CACHE_DYNAMIC   1

Definition at line 74 of file i915_context.h.

#define I915_CACHE_MAP   3

Definition at line 76 of file i915_context.h.

#define I915_CACHE_PROGRAM   4

Definition at line 77 of file i915_context.h.

#define I915_CACHE_SAMPLER   2

Definition at line 75 of file i915_context.h.

#define I915_CACHE_STATIC   0

Definition at line 73 of file i915_context.h.

#define I915_CONSTFLAG_USER   0x1f

See constant_flags[] below.

Definition at line 85 of file i915_context.h.

#define I915_DYNAMIC_BC_0   4

Definition at line 47 of file i915_context.h.

#define I915_DYNAMIC_BC_1   5

Definition at line 48 of file i915_context.h.

#define I915_DYNAMIC_BFO_0   6

Definition at line 49 of file i915_context.h.

#define I915_DYNAMIC_BFO_1   7

Definition at line 50 of file i915_context.h.

#define I915_DYNAMIC_DEPTHSCALE_0   1

Definition at line 44 of file i915_context.h.

#define I915_DYNAMIC_DEPTHSCALE_1   2

Definition at line 45 of file i915_context.h.

#define I915_DYNAMIC_IAB   3

Definition at line 46 of file i915_context.h.

#define I915_DYNAMIC_MODES4   0

Definition at line 43 of file i915_context.h.

#define I915_DYNAMIC_SC_ENA_0   10

Definition at line 53 of file i915_context.h.

#define I915_DYNAMIC_SC_RECT_0   11

Definition at line 54 of file i915_context.h.

#define I915_DYNAMIC_SC_RECT_1   12

Definition at line 55 of file i915_context.h.

#define I915_DYNAMIC_SC_RECT_2   13

Definition at line 56 of file i915_context.h.

#define I915_DYNAMIC_STP_0   8

Definition at line 51 of file i915_context.h.

#define I915_DYNAMIC_STP_1   9

Definition at line 52 of file i915_context.h.

#define I915_HW_CONSTANTS   (1<<I915_CACHE_CONSTANTS)

Definition at line 290 of file i915_context.h.

#define I915_HW_DYNAMIC   (1<<I915_CACHE_DYNAMIC)

Definition at line 286 of file i915_context.h.

#define I915_HW_IMMEDIATE   (1<<(I915_MAX_CACHE+0))

Definition at line 291 of file i915_context.h.

#define I915_HW_INVARIENT   (1<<(I915_MAX_CACHE+1))

Definition at line 292 of file i915_context.h.

#define I915_HW_MAP   (1<<I915_CACHE_MAP)

Definition at line 288 of file i915_context.h.

#define I915_HW_PROGRAM   (1<<I915_CACHE_PROGRAM)

Definition at line 289 of file i915_context.h.

#define I915_HW_SAMPLER   (1<<I915_CACHE_SAMPLER)

Definition at line 287 of file i915_context.h.

#define I915_HW_STATIC   (1<<I915_CACHE_STATIC)

Definition at line 285 of file i915_context.h.

#define I915_IMMEDIATE_S0   0

Definition at line 60 of file i915_context.h.

#define I915_IMMEDIATE_S1   1

Definition at line 61 of file i915_context.h.

#define I915_IMMEDIATE_S2   2

Definition at line 62 of file i915_context.h.

#define I915_IMMEDIATE_S3   3

Definition at line 63 of file i915_context.h.

#define I915_IMMEDIATE_S4   4

Definition at line 64 of file i915_context.h.

#define I915_IMMEDIATE_S5   5

Definition at line 65 of file i915_context.h.

#define I915_IMMEDIATE_S6   6

Definition at line 66 of file i915_context.h.

#define I915_IMMEDIATE_S7   7

Definition at line 67 of file i915_context.h.

#define I915_MAX_CACHE   6

Definition at line 79 of file i915_context.h.

#define I915_MAX_CONSTANT   32

Definition at line 81 of file i915_context.h.

#define I915_MAX_DYNAMIC   14

Definition at line 57 of file i915_context.h.

#define I915_MAX_IMMEDIATE   8

Definition at line 68 of file i915_context.h.

#define I915_NEW_ALPHA_TEST   0x100

Definition at line 269 of file i915_context.h.

#define I915_NEW_BLEND   0x8

Definition at line 264 of file i915_context.h.

#define I915_NEW_CLIP   0x10

Definition at line 265 of file i915_context.h.

#define I915_NEW_CONSTANTS   0x1000

Definition at line 273 of file i915_context.h.

#define I915_NEW_DEPTH_STENCIL   0x200

Definition at line 270 of file i915_context.h.

#define I915_NEW_FRAMEBUFFER   0x80

Definition at line 268 of file i915_context.h.

#define I915_NEW_FS   0x4

Definition at line 263 of file i915_context.h.

#define I915_NEW_RASTERIZER   0x2

Definition at line 262 of file i915_context.h.

#define I915_NEW_SAMPLER   0x400

Definition at line 271 of file i915_context.h.

#define I915_NEW_SCISSOR   0x20

Definition at line 266 of file i915_context.h.

#define I915_NEW_STIPPLE   0x40

Definition at line 267 of file i915_context.h.

#define I915_NEW_TEXTURE   0x800

Definition at line 272 of file i915_context.h.

#define I915_NEW_VBO   0x2000

Definition at line 274 of file i915_context.h.

#define I915_NEW_VERTEX_FORMAT   0x10000

Definition at line 280 of file i915_context.h.

#define I915_NEW_VIEWPORT   0x1

Definition at line 261 of file i915_context.h.

#define I915_NEW_VS   0x4000

Definition at line 275 of file i915_context.h.

#define I915_TEX_UNITS   8

Definition at line 41 of file i915_context.h.


Function Documentation

void i915_clear ( struct pipe_context pipe,
struct pipe_surface ps,
unsigned  clearValue 
)

Clear the given surface to the specified value.

No masking, no scissor (clear entire buffer).

Definition at line 43 of file i915_clear.c.

References pipe_surface::height, PIPE_SURFACE_STATUS_DEFINED, pipe_surface::status, pipe_context::surface_fill, and pipe_surface::width.

00045 {
00046    pipe->surface_fill(pipe, ps, 0, 0, ps->width, ps->height, clearValue);
00047    ps->status = PIPE_SURFACE_STATUS_DEFINED;
00048 }

static struct i915_context* i915_context ( struct pipe_context pipe  )  [static, read]

Definition at line 338 of file i915_context.h.

00339 {
00340    return (struct i915_context *)pipe;
00341 }

struct draw_stage* i915_draw_render_stage ( struct i915_context i915  )  [read]

Create a new primitive setup/render stage.

This gets plugged into the 'draw' module's pipeline.

Definition at line 206 of file i915_prim_emit.c.

References CALLOC_STRUCT, draw_stage::destroy, i915_context::draw, draw_stage::draw, draw_stage::flush, setup_stage::i915, draw_stage::line, draw_stage::point, render_destroy(), reset_stipple_counter(), draw_stage::reset_stipple_counter, setup, setup_flush(), setup_line(), setup_point(), setup_tri(), setup_stage::stage, and draw_stage::tri.

00207 {
00208    struct setup_stage *setup = CALLOC_STRUCT(setup_stage);
00209 
00210    setup->i915 = i915;
00211    setup->stage.draw = i915->draw;
00212    setup->stage.point = setup_point;
00213    setup->stage.line = setup_line;
00214    setup->stage.tri = setup_tri;
00215    setup->stage.flush = setup_flush;
00216    setup->stage.reset_stipple_counter = reset_stipple_counter;
00217    setup->stage.destroy = render_destroy;
00218 
00219    return &setup->stage;
00220 }

struct draw_stage* i915_draw_vbuf_stage ( struct i915_context i915  )  [read]

Create a new primitive vbuf/render stage.

TODO JB: this shouldn't be here

Definition at line 529 of file i915_prim_vbuf.c.

References vbuf_render::destroy, i915_context::draw, draw_set_render(), draw_vbuf_stage(), and i915_vbuf_render_create().

00530 {
00531    struct vbuf_render *render;
00532    struct draw_stage *stage;
00533    
00534    render = i915_vbuf_render_create(i915);
00535    if(!render)
00536       return NULL;
00537    
00538    stage = draw_vbuf_stage( i915->draw, render );
00539    if(!stage) {
00540       render->destroy(render);
00541       return NULL;
00542    }
00544    draw_set_render(i915->draw, render);
00545 
00546    return stage;
00547 }

void i915_emit_hardware_state ( struct i915_context i915  ) 

Definition at line 92 of file i915_state_emit.c.

00093 {
00094    /* XXX: there must be an easier way */
00095    const unsigned dwords = ( 14 + 
00096                              7 + 
00097                              I915_MAX_DYNAMIC + 
00098                              8 + 
00099                              2 + I915_TEX_UNITS*3 + 
00100                              2 + I915_TEX_UNITS*3 +
00101                              2 + I915_MAX_CONSTANT*4 + 
00102 #if 0
00103                              i915->current.program_len + 
00104 #else
00105                              i915->fs->program_len + 
00106 #endif
00107                              6 
00108                            ) * 3/2; /* plus 50% margin */
00109    const unsigned relocs = ( I915_TEX_UNITS +
00110                              3
00111                            ) * 3/2; /* plus 50% margin */
00112 
00113 #if 0
00114    debug_printf("i915_emit_hardware_state: %d dwords, %d relocs\n", dwords, relocs);
00115 #endif
00116    
00117    if(!BEGIN_BATCH(dwords, relocs)) {
00118       FLUSH_BATCH(NULL);
00119       assert(BEGIN_BATCH(dwords, relocs));
00120    }
00121 
00122    /* 14 dwords, 0 relocs */
00123    if (i915->hardware_dirty & I915_HW_INVARIENT)
00124    {
00125       OUT_BATCH(_3DSTATE_AA_CMD |
00126                 AA_LINE_ECAAR_WIDTH_ENABLE |
00127                 AA_LINE_ECAAR_WIDTH_1_0 |
00128                 AA_LINE_REGION_WIDTH_ENABLE | AA_LINE_REGION_WIDTH_1_0);
00129 
00130       OUT_BATCH(_3DSTATE_DFLT_DIFFUSE_CMD);
00131       OUT_BATCH(0);
00132 
00133       OUT_BATCH(_3DSTATE_DFLT_SPEC_CMD);
00134       OUT_BATCH(0);
00135       
00136       OUT_BATCH(_3DSTATE_DFLT_Z_CMD);
00137       OUT_BATCH(0);
00138 
00139       OUT_BATCH(_3DSTATE_COORD_SET_BINDINGS |
00140                 CSB_TCB(0, 0) |
00141                 CSB_TCB(1, 1) |
00142                 CSB_TCB(2, 2) |
00143                 CSB_TCB(3, 3) |
00144                 CSB_TCB(4, 4) | 
00145                 CSB_TCB(5, 5) | 
00146                 CSB_TCB(6, 6) | 
00147                 CSB_TCB(7, 7));
00148 
00149       OUT_BATCH(_3DSTATE_RASTER_RULES_CMD |
00150                 ENABLE_POINT_RASTER_RULE |
00151                 OGL_POINT_RASTER_RULE |
00152                 ENABLE_LINE_STRIP_PROVOKE_VRTX |
00153                 ENABLE_TRI_FAN_PROVOKE_VRTX |
00154                 LINE_STRIP_PROVOKE_VRTX(1) |
00155                 TRI_FAN_PROVOKE_VRTX(2) | 
00156                 ENABLE_TEXKILL_3D_4D | 
00157                 TEXKILL_4D);
00158 
00159       /* Need to initialize this to zero.
00160        */
00161       OUT_BATCH(_3DSTATE_LOAD_STATE_IMMEDIATE_1 | I1_LOAD_S(3) | (0));
00162       OUT_BATCH(0);
00163 
00164       OUT_BATCH(_3DSTATE_DEPTH_SUBRECT_DISABLE);
00165 
00166       /* disable indirect state for now
00167        */
00168       OUT_BATCH(_3DSTATE_LOAD_INDIRECT | 0);
00169       OUT_BATCH(0);
00170    }
00171    
00172    /* 7 dwords, 1 relocs */
00173    if (i915->hardware_dirty & I915_HW_IMMEDIATE)
00174    {
00175       OUT_BATCH(_3DSTATE_LOAD_STATE_IMMEDIATE_1 | 
00176                 I1_LOAD_S(0) |
00177                 I1_LOAD_S(1) |
00178                 I1_LOAD_S(2) |
00179                 I1_LOAD_S(4) |
00180                 I1_LOAD_S(5) |
00181                 I1_LOAD_S(6) | 
00182                 (5));
00183       
00184       if(i915->vbo)
00185          OUT_RELOC(i915->vbo,
00186                    I915_BUFFER_ACCESS_READ,
00187                    i915->current.immediate[I915_IMMEDIATE_S0]);
00188       else
00189          /* FIXME: we should not do this */
00190          OUT_BATCH(0);
00191       OUT_BATCH(i915->current.immediate[I915_IMMEDIATE_S1]);
00192       OUT_BATCH(i915->current.immediate[I915_IMMEDIATE_S2]);
00193       OUT_BATCH(i915->current.immediate[I915_IMMEDIATE_S4]);
00194       OUT_BATCH(i915->current.immediate[I915_IMMEDIATE_S5]);
00195       OUT_BATCH(i915->current.immediate[I915_IMMEDIATE_S6]);
00196    } 
00197    
00198    /* I915_MAX_DYNAMIC dwords, 0 relocs */
00199    if (i915->hardware_dirty & I915_HW_DYNAMIC) 
00200    {
00201       int i;
00202       for (i = 0; i < I915_MAX_DYNAMIC; i++) {
00203          OUT_BATCH(i915->current.dynamic[i]);
00204       }
00205    }
00206    
00207    /* 8 dwords, 2 relocs */
00208    if (i915->hardware_dirty & I915_HW_STATIC)
00209    {
00210       struct pipe_surface *cbuf_surface = i915->framebuffer.cbufs[0];
00211       struct pipe_surface *depth_surface = i915->framebuffer.zsbuf;
00212 
00213       if (cbuf_surface) {
00214          unsigned cpitch = cbuf_surface->stride;
00215          unsigned ctile = BUF_3D_USE_FENCE;
00216          if (cbuf_surface->texture &&
00217                ((struct i915_texture*)(cbuf_surface->texture))->tiled) {
00218             ctile = BUF_3D_TILED_SURFACE;
00219          }
00220 
00221          OUT_BATCH(_3DSTATE_BUF_INFO_CMD);
00222 
00223          OUT_BATCH(BUF_3D_ID_COLOR_BACK | 
00224                    BUF_3D_PITCH(cpitch) |  /* pitch in bytes */
00225                    ctile);
00226 
00227          OUT_RELOC(cbuf_surface->buffer,
00228                    I915_BUFFER_ACCESS_WRITE,
00229                    cbuf_surface->offset);
00230       }
00231 
00232       /* What happens if no zbuf??
00233        */
00234       if (depth_surface) {
00235          unsigned zpitch = depth_surface->stride;
00236          unsigned ztile = BUF_3D_USE_FENCE;
00237          if (depth_surface->texture &&
00238                ((struct i915_texture*)(depth_surface->texture))->tiled) {
00239             ztile = BUF_3D_TILED_SURFACE;
00240          }
00241 
00242          OUT_BATCH(_3DSTATE_BUF_INFO_CMD);
00243 
00244          OUT_BATCH(BUF_3D_ID_DEPTH |
00245                    BUF_3D_PITCH(zpitch) |  /* pitch in bytes */
00246                    ztile);
00247 
00248          OUT_RELOC(depth_surface->buffer,
00249                    I915_BUFFER_ACCESS_WRITE,
00250                    depth_surface->offset);
00251       }
00252    
00253       {
00254          unsigned cformat, zformat = 0;
00255       
00256          if (cbuf_surface)
00257             cformat = cbuf_surface->format;
00258          else
00259             cformat = PIPE_FORMAT_A8R8G8B8_UNORM; /* arbitrary */
00260          cformat = translate_format(cformat);
00261 
00262          if (depth_surface) 
00263             zformat = translate_depth_format( i915->framebuffer.zsbuf->format );
00264 
00265          OUT_BATCH(_3DSTATE_DST_BUF_VARS_CMD);
00266          OUT_BATCH(DSTORG_HORT_BIAS(0x8) | /* .5 */
00267                    DSTORG_VERT_BIAS(0x8) | /* .5 */
00268                    LOD_PRECLAMP_OGL |
00269                    TEX_DEFAULT_COLOR_OGL |
00270                    cformat |
00271                    zformat );
00272       }
00273    }
00274 
00275 #if 01
00276       /* texture images */
00277       /* 2 + I915_TEX_UNITS*3 dwords, I915_TEX_UNITS relocs */
00278       if (i915->hardware_dirty & (I915_HW_MAP | I915_HW_SAMPLER))
00279       {
00280          const uint nr = i915->current.sampler_enable_nr;
00281          if (nr) {
00282             const uint enabled = i915->current.sampler_enable_flags;
00283             uint unit;
00284             uint count = 0;
00285             OUT_BATCH(_3DSTATE_MAP_STATE | (3 * nr));
00286             OUT_BATCH(enabled);
00287             for (unit = 0; unit < I915_TEX_UNITS; unit++) {
00288                if (enabled & (1 << unit)) {
00289                   struct pipe_buffer *buf =
00290                      i915->texture[unit]->buffer;
00291                   uint offset = 0;
00292                   assert(buf);
00293 
00294                   count++;
00295 
00296                   OUT_RELOC(buf,
00297                             I915_BUFFER_ACCESS_READ,
00298                             offset);
00299                   OUT_BATCH(i915->current.texbuffer[unit][0]); /* MS3 */
00300                   OUT_BATCH(i915->current.texbuffer[unit][1]); /* MS4 */
00301                }
00302             }
00303             assert(count == nr);
00304          }
00305       }
00306 #endif
00307 
00308 #if 01
00309    /* samplers */
00310    /* 2 + I915_TEX_UNITS*3 dwords, 0 relocs */
00311    if (i915->hardware_dirty & I915_HW_SAMPLER) 
00312    {
00313       if (i915->current.sampler_enable_nr) {
00314          int i;
00315          
00316          OUT_BATCH( _3DSTATE_SAMPLER_STATE | 
00317                     (3 * i915->current.sampler_enable_nr) );
00318 
00319          OUT_BATCH( i915->current.sampler_enable_flags );
00320 
00321          for (i = 0; i < I915_TEX_UNITS; i++) {
00322             if (i915->current.sampler_enable_flags & (1<<i)) {
00323                OUT_BATCH( i915->current.sampler[i][0] );
00324                OUT_BATCH( i915->current.sampler[i][1] );
00325                OUT_BATCH( i915->current.sampler[i][2] );
00326             }
00327          }
00328       }
00329    }
00330 #endif
00331 
00332    /* constants */
00333    /* 2 + I915_MAX_CONSTANT*4 dwords, 0 relocs */
00334    if (i915->hardware_dirty & I915_HW_PROGRAM)
00335    {
00336       /* Collate the user-defined constants with the fragment shader's
00337        * immediates according to the constant_flags[] array.
00338        */
00339       const uint nr = i915->fs->num_constants;
00340       if (nr) {
00341          uint i;
00342 
00343          OUT_BATCH( _3DSTATE_PIXEL_SHADER_CONSTANTS | (nr * 4) );
00344          OUT_BATCH( (1 << (nr - 1)) | ((1 << (nr - 1)) - 1) );
00345 
00346          for (i = 0; i < nr; i++) {
00347             const uint *c;
00348             if (i915->fs->constant_flags[i] == I915_CONSTFLAG_USER) {
00349                /* grab user-defined constant */
00350                c = (uint *) i915->current.constants[PIPE_SHADER_FRAGMENT][i];
00351             }
00352             else {
00353                /* emit program constant */
00354                c = (uint *) i915->fs->constants[i];
00355             }
00356 #if 0 /* debug */
00357             {
00358                float *f = (float *) c;
00359                printf("Const %2d: %f %f %f %f %s\n", i, f[0], f[1], f[2], f[3],
00360                       (i915->fs->constant_flags[i] == I915_CONSTFLAG_USER
00361                        ? "user" : "immediate"));
00362             }
00363 #endif
00364             OUT_BATCH(*c++);
00365             OUT_BATCH(*c++);
00366             OUT_BATCH(*c++);
00367             OUT_BATCH(*c++);
00368          }
00369       }
00370    }
00371 
00372    /* Fragment program */
00373    /* i915->current.program_len dwords, 0 relocs */
00374    if (i915->hardware_dirty & I915_HW_PROGRAM)
00375    {
00376       uint i;
00377       /* we should always have, at least, a pass-through program */
00378       assert(i915->fs->program_len > 0);
00379       for (i = 0; i < i915->fs->program_len; i++) {
00380          OUT_BATCH(i915->fs->program[i]);
00381       }
00382    }
00383 
00384    /* drawing surface size */
00385    /* 6 dwords, 0 relocs */
00386    {
00387       uint w, h;
00388       boolean k = framebuffer_size(&i915->framebuffer, &w, &h);
00389       (void)k;
00390       assert(k);
00391 
00392       OUT_BATCH(_3DSTATE_DRAW_RECT_CMD);
00393       OUT_BATCH(0);
00394       OUT_BATCH(0);
00395       OUT_BATCH(((w - 1) & 0xffff) | ((h - 1) << 16));
00396       OUT_BATCH(0);
00397       OUT_BATCH(0);
00398    }
00399 
00400 
00401    i915->hardware_dirty = 0;
00402 }

void i915_init_flush_functions ( struct i915_context i915  ) 

Definition at line 75 of file i915_flush.c.

References pipe_context::flush, i915_flush(), and i915_context::pipe.

00076 {
00077    i915->pipe.flush = i915_flush;
00078 }

void i915_init_state_functions ( struct i915_context i915  ) 

Definition at line 752 of file i915_state.c.

References pipe_context::bind_blend_state, pipe_context::bind_depth_stencil_alpha_state, pipe_context::bind_fs_state, pipe_context::bind_rasterizer_state, pipe_context::bind_sampler_states, pipe_context::bind_vs_state, pipe_context::create_blend_state, pipe_context::create_depth_stencil_alpha_state, pipe_context::create_fs_state, pipe_context::create_rasterizer_state, pipe_context::create_sampler_state, pipe_context::create_vs_state, pipe_context::delete_blend_state, pipe_context::delete_depth_stencil_alpha_state, pipe_context::delete_fs_state, pipe_context::delete_rasterizer_state, pipe_context::delete_sampler_state, pipe_context::delete_vs_state, i915_bind_blend_state(), i915_bind_depth_stencil_state(), i915_bind_fs_state(), i915_bind_rasterizer_state(), i915_bind_sampler_states(), i915_bind_vs_state(), i915_create_blend_state(), i915_create_depth_stencil_state(), i915_create_fs_state(), i915_create_rasterizer_state(), i915_create_sampler_state(), i915_create_vs_state(), i915_delete_blend_state(), i915_delete_depth_stencil_state(), i915_delete_fs_state(), i915_delete_rasterizer_state(), i915_delete_sampler_state(), i915_delete_vs_state(), i915_set_blend_color(), i915_set_clip_state(), i915_set_constant_buffer(), i915_set_edgeflags(), i915_set_framebuffer_state(), i915_set_polygon_stipple(), i915_set_sampler_textures(), i915_set_scissor_state(), i915_set_vertex_buffers(), i915_set_vertex_elements(), i915_set_viewport_state(), i915_context::pipe, pipe_context::set_blend_color, pipe_context::set_clip_state, pipe_context::set_constant_buffer, pipe_context::set_edgeflags, pipe_context::set_framebuffer_state, pipe_context::set_polygon_stipple, pipe_context::set_sampler_textures, pipe_context::set_scissor_state, pipe_context::set_vertex_buffers, pipe_context::set_vertex_elements, and pipe_context::set_viewport_state.

00753 {
00754    i915->pipe.set_edgeflags = i915_set_edgeflags;
00755    i915->pipe.create_blend_state = i915_create_blend_state;
00756    i915->pipe.bind_blend_state = i915_bind_blend_state;
00757    i915->pipe.delete_blend_state = i915_delete_blend_state;
00758 
00759    i915->pipe.create_sampler_state = i915_create_sampler_state;
00760    i915->pipe.bind_sampler_states = i915_bind_sampler_states;
00761    i915->pipe.delete_sampler_state = i915_delete_sampler_state;
00762 
00763    i915->pipe.create_depth_stencil_alpha_state = i915_create_depth_stencil_state;
00764    i915->pipe.bind_depth_stencil_alpha_state = i915_bind_depth_stencil_state;
00765    i915->pipe.delete_depth_stencil_alpha_state = i915_delete_depth_stencil_state;
00766 
00767    i915->pipe.create_rasterizer_state = i915_create_rasterizer_state;
00768    i915->pipe.bind_rasterizer_state = i915_bind_rasterizer_state;
00769    i915->pipe.delete_rasterizer_state = i915_delete_rasterizer_state;
00770    i915->pipe.create_fs_state = i915_create_fs_state;
00771    i915->pipe.bind_fs_state = i915_bind_fs_state;
00772    i915->pipe.delete_fs_state = i915_delete_fs_state;
00773    i915->pipe.create_vs_state = i915_create_vs_state;
00774    i915->pipe.bind_vs_state = i915_bind_vs_state;
00775    i915->pipe.delete_vs_state = i915_delete_vs_state;
00776 
00777    i915->pipe.set_blend_color = i915_set_blend_color;
00778    i915->pipe.set_clip_state = i915_set_clip_state;
00779    i915->pipe.set_constant_buffer = i915_set_constant_buffer;
00780    i915->pipe.set_framebuffer_state = i915_set_framebuffer_state;
00781 
00782    i915->pipe.set_polygon_stipple = i915_set_polygon_stipple;
00783    i915->pipe.set_scissor_state = i915_set_scissor_state;
00784    i915->pipe.set_sampler_textures = i915_set_sampler_textures;
00785    i915->pipe.set_viewport_state = i915_set_viewport_state;
00786    i915->pipe.set_vertex_buffers = i915_set_vertex_buffers;
00787    i915->pipe.set_vertex_elements = i915_set_vertex_elements;
00788 }

void i915_init_string_functions ( struct i915_context i915  ) 

void i915_init_surface_functions ( struct i915_context i915  ) 

Definition at line 119 of file i915_surface.c.

References i915_surface_copy(), i915_surface_fill(), i915_context::pipe, pipe_context::surface_copy, and pipe_context::surface_fill.

00120 {
00121    i915->pipe.surface_copy = i915_surface_copy;
00122    i915->pipe.surface_fill = i915_surface_fill;
00123 }


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