1 /**************************************************************************
3 * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sub license, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21 * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
22 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 **************************************************************************/
29 #include "i830_context.h"
31 #include "intel_batchbuffer.h"
32 #include "intel_regions.h"
33 #include "tnl/t_context.h"
34 #include "tnl/t_vertex.h"
36 #define FILE_DEBUG_FLAG DEBUG_STATE
38 static GLboolean
i830_check_vertex_size(struct intel_context
*intel
,
41 #define SZ_TO_HW(sz) ((sz-2)&0x3)
42 #define EMIT_SZ(sz) (EMIT_1F + (sz) - 1)
43 #define EMIT_ATTR( ATTR, STYLE, V0 ) \
45 intel->vertex_attrs[intel->vertex_attr_count].attrib = (ATTR); \
46 intel->vertex_attrs[intel->vertex_attr_count].format = (STYLE); \
47 intel->vertex_attr_count++; \
51 #define EMIT_PAD( N ) \
53 intel->vertex_attrs[intel->vertex_attr_count].attrib = 0; \
54 intel->vertex_attrs[intel->vertex_attr_count].format = EMIT_PAD; \
55 intel->vertex_attrs[intel->vertex_attr_count].offset = (N); \
56 intel->vertex_attr_count++; \
60 #define VRTX_TEX_SET_FMT(n, x) ((x)<<((n)*2))
61 #define TEXBIND_SET(n, x) ((x)<<((n)*4))
64 i830_render_prevalidate(struct intel_context
*intel
)
69 i830_render_start(struct intel_context
*intel
)
71 GLcontext
*ctx
= &intel
->ctx
;
72 struct i830_context
*i830
= i830_context(ctx
);
73 TNLcontext
*tnl
= TNL_CONTEXT(ctx
);
74 struct vertex_buffer
*VB
= &tnl
->vb
;
75 DECLARE_RENDERINPUTS(index_bitset
);
76 GLuint v0
= _3DSTATE_VFT0_CMD
;
77 GLuint v2
= _3DSTATE_VFT1_CMD
;
80 RENDERINPUTS_COPY(index_bitset
, tnl
->render_inputs_bitset
);
84 VB
->AttribPtr
[VERT_ATTRIB_POS
] = VB
->NdcPtr
;
85 intel
->vertex_attr_count
= 0;
87 /* EMIT_ATTR's must be in order as they tell t_vertex.c how to
88 * build up a hardware vertex.
90 if (RENDERINPUTS_TEST_RANGE(index_bitset
, _TNL_FIRST_TEX
, _TNL_LAST_TEX
)) {
91 EMIT_ATTR(_TNL_ATTRIB_POS
, EMIT_4F_VIEWPORT
, VFT0_XYZW
);
92 intel
->coloroffset
= 4;
95 EMIT_ATTR(_TNL_ATTRIB_POS
, EMIT_3F_VIEWPORT
, VFT0_XYZ
);
96 intel
->coloroffset
= 3;
99 if (RENDERINPUTS_TEST(index_bitset
, _TNL_ATTRIB_POINTSIZE
)) {
100 EMIT_ATTR(_TNL_ATTRIB_POINTSIZE
, EMIT_1F
, VFT0_POINT_WIDTH
);
103 EMIT_ATTR(_TNL_ATTRIB_COLOR0
, EMIT_4UB_4F_BGRA
, VFT0_DIFFUSE
);
105 intel
->specoffset
= 0;
106 if (RENDERINPUTS_TEST(index_bitset
, _TNL_ATTRIB_COLOR1
) ||
107 RENDERINPUTS_TEST(index_bitset
, _TNL_ATTRIB_FOG
)) {
108 if (RENDERINPUTS_TEST(index_bitset
, _TNL_ATTRIB_COLOR1
)) {
109 intel
->specoffset
= intel
->coloroffset
+ 1;
110 EMIT_ATTR(_TNL_ATTRIB_COLOR1
, EMIT_3UB_3F_BGR
, VFT0_SPEC
);
115 if (RENDERINPUTS_TEST(index_bitset
, _TNL_ATTRIB_FOG
))
116 EMIT_ATTR(_TNL_ATTRIB_FOG
, EMIT_1UB_1F
, VFT0_SPEC
);
121 if (RENDERINPUTS_TEST_RANGE(index_bitset
, _TNL_FIRST_TEX
, _TNL_LAST_TEX
)) {
124 for (i
= 0; i
< I830_TEX_UNITS
; i
++) {
125 if (RENDERINPUTS_TEST(index_bitset
, _TNL_ATTRIB_TEX(i
))) {
126 GLuint sz
= VB
->TexCoordPtr
[i
]->size
;
128 GLuint mcs
= (i830
->state
.Tex
[i
][I830_TEXREG_MCS
] &
136 mcs
|= TEXCOORDTYPE_CARTESIAN
;
141 mcs
|= TEXCOORDTYPE_VECTOR
;
146 mcs
|= TEXCOORDTYPE_HOMOGENEOUS
;
153 EMIT_ATTR(_TNL_ATTRIB_TEX0
+ i
, emit
, 0);
154 v2
|= VRTX_TEX_SET_FMT(count
, SZ_TO_HW(sz
));
155 mcsb1
|= (count
+ 8) << (i
* 4);
157 if (mcs
!= i830
->state
.Tex
[i
][I830_TEXREG_MCS
]) {
158 I830_STATECHANGE(i830
, I830_UPLOAD_TEX(i
));
159 i830
->state
.Tex
[i
][I830_TEXREG_MCS
] = mcs
;
166 v0
|= VFT0_TEX_COUNT(count
);
169 /* Only need to change the vertex emit code if there has been a
170 * statechange to a new hardware vertex format:
172 if (v0
!= i830
->state
.Ctx
[I830_CTXREG_VF
] ||
173 v2
!= i830
->state
.Ctx
[I830_CTXREG_VF2
] ||
174 mcsb1
!= i830
->state
.Ctx
[I830_CTXREG_MCSB1
] ||
175 !RENDERINPUTS_EQUAL(index_bitset
, i830
->last_index_bitset
)) {
178 I830_STATECHANGE(i830
, I830_UPLOAD_CTX
);
180 /* Must do this *after* statechange, so as not to affect
181 * buffered vertices reliant on the old state:
184 _tnl_install_attrs(ctx
,
186 intel
->vertex_attr_count
,
187 intel
->ViewportMatrix
.m
, 0);
189 intel
->vertex_size
>>= 2;
191 i830
->state
.Ctx
[I830_CTXREG_VF
] = v0
;
192 i830
->state
.Ctx
[I830_CTXREG_VF2
] = v2
;
193 i830
->state
.Ctx
[I830_CTXREG_MCSB1
] = mcsb1
;
194 RENDERINPUTS_COPY(i830
->last_index_bitset
, index_bitset
);
196 k
= i830_check_vertex_size(intel
, intel
->vertex_size
);
202 i830_reduced_primitive_state(struct intel_context
*intel
, GLenum rprim
)
204 struct i830_context
*i830
= i830_context(&intel
->ctx
);
205 GLuint st1
= i830
->state
.Stipple
[I830_STPREG_ST1
];
211 if (intel
->ctx
.Polygon
.StippleFlag
&& intel
->hw_stipple
)
220 i830
->intel
.reduced_primitive
= rprim
;
222 if (st1
!= i830
->state
.Stipple
[I830_STPREG_ST1
]) {
223 INTEL_FIREVERTICES(intel
);
225 I830_STATECHANGE(i830
, I830_UPLOAD_STIPPLE
);
226 i830
->state
.Stipple
[I830_STPREG_ST1
] = st1
;
230 /* Pull apart the vertex format registers and figure out how large a
231 * vertex is supposed to be.
234 i830_check_vertex_size(struct intel_context
*intel
, GLuint expected
)
236 struct i830_context
*i830
= i830_context(&intel
->ctx
);
237 int vft0
= i830
->current
->Ctx
[I830_CTXREG_VF
];
238 int vft1
= i830
->current
->Ctx
[I830_CTXREG_VF2
];
239 int nrtex
= (vft0
& VFT0_TEX_COUNT_MASK
) >> VFT0_TEX_COUNT_SHIFT
;
242 switch (vft0
& VFT0_XYZW_MASK
) {
256 fprintf(stderr
, "no xyzw specified\n");
260 if (vft0
& VFT0_SPEC
)
262 if (vft0
& VFT0_DIFFUSE
)
264 if (vft0
& VFT0_DEPTH_OFFSET
)
266 if (vft0
& VFT0_POINT_WIDTH
)
269 for (i
= 0; i
< nrtex
; i
++) {
270 switch (vft1
& VFT1_TEX0_MASK
) {
284 vft1
>>= VFT1_TEX1_SHIFT
;
288 fprintf(stderr
, "vertex size mismatch %d/%d\n", sz
, expected
);
290 return sz
== expected
;
294 i830_emit_invarient_state(struct intel_context
*intel
)
300 OUT_BATCH(_3DSTATE_DFLT_DIFFUSE_CMD
);
303 OUT_BATCH(_3DSTATE_DFLT_SPEC_CMD
);
306 OUT_BATCH(_3DSTATE_DFLT_Z_CMD
);
309 OUT_BATCH(_3DSTATE_FOG_MODE_CMD
);
310 OUT_BATCH(FOGFUNC_ENABLE
|
311 FOG_LINEAR_CONST
| FOGSRC_INDEX_Z
| ENABLE_FOG_DENSITY
);
316 OUT_BATCH(_3DSTATE_MAP_TEX_STREAM_CMD
|
318 DISABLE_TEX_STREAM_BUMP
|
319 ENABLE_TEX_STREAM_COORD_SET
|
320 TEX_STREAM_COORD_SET(0) |
321 ENABLE_TEX_STREAM_MAP_IDX
| TEX_STREAM_MAP_IDX(0));
322 OUT_BATCH(_3DSTATE_MAP_TEX_STREAM_CMD
|
324 DISABLE_TEX_STREAM_BUMP
|
325 ENABLE_TEX_STREAM_COORD_SET
|
326 TEX_STREAM_COORD_SET(1) |
327 ENABLE_TEX_STREAM_MAP_IDX
| TEX_STREAM_MAP_IDX(1));
328 OUT_BATCH(_3DSTATE_MAP_TEX_STREAM_CMD
|
330 DISABLE_TEX_STREAM_BUMP
|
331 ENABLE_TEX_STREAM_COORD_SET
|
332 TEX_STREAM_COORD_SET(2) |
333 ENABLE_TEX_STREAM_MAP_IDX
| TEX_STREAM_MAP_IDX(2));
334 OUT_BATCH(_3DSTATE_MAP_TEX_STREAM_CMD
|
336 DISABLE_TEX_STREAM_BUMP
|
337 ENABLE_TEX_STREAM_COORD_SET
|
338 TEX_STREAM_COORD_SET(3) |
339 ENABLE_TEX_STREAM_MAP_IDX
| TEX_STREAM_MAP_IDX(3));
341 OUT_BATCH(_3DSTATE_MAP_COORD_TRANSFORM
);
342 OUT_BATCH(DISABLE_TEX_TRANSFORM
| TEXTURE_SET(0));
343 OUT_BATCH(_3DSTATE_MAP_COORD_TRANSFORM
);
344 OUT_BATCH(DISABLE_TEX_TRANSFORM
| TEXTURE_SET(1));
345 OUT_BATCH(_3DSTATE_MAP_COORD_TRANSFORM
);
346 OUT_BATCH(DISABLE_TEX_TRANSFORM
| TEXTURE_SET(2));
347 OUT_BATCH(_3DSTATE_MAP_COORD_TRANSFORM
);
348 OUT_BATCH(DISABLE_TEX_TRANSFORM
| TEXTURE_SET(3));
350 OUT_BATCH(_3DSTATE_RASTER_RULES_CMD
|
351 ENABLE_POINT_RASTER_RULE
|
352 OGL_POINT_RASTER_RULE
|
353 ENABLE_LINE_STRIP_PROVOKE_VRTX
|
354 ENABLE_TRI_FAN_PROVOKE_VRTX
|
355 ENABLE_TRI_STRIP_PROVOKE_VRTX
|
356 LINE_STRIP_PROVOKE_VRTX(1) |
357 TRI_FAN_PROVOKE_VRTX(2) | TRI_STRIP_PROVOKE_VRTX(2));
359 OUT_BATCH(_3DSTATE_VERTEX_TRANSFORM
);
360 OUT_BATCH(DISABLE_VIEWPORT_TRANSFORM
| DISABLE_PERSPECTIVE_DIVIDE
);
362 OUT_BATCH(_3DSTATE_W_STATE_CMD
);
363 OUT_BATCH(MAGIC_W_STATE_DWORD1
);
364 OUT_BATCH(0x3f800000 /* 1.0 in IEEE float */ );
367 OUT_BATCH(_3DSTATE_COLOR_FACTOR_CMD
);
368 OUT_BATCH(0x80808080); /* .5 required in alpha for GL_DOT3_RGBA_EXT */
374 #define emit( intel, state, size ) \
377 BEGIN_BATCH(size / sizeof(GLuint), 0); \
378 for (k = 0 ; k < size / sizeof(GLuint) ; k++) { \
379 if (0) _mesa_printf(" 0x%08x\n", state[k]); \
380 OUT_BATCH(state[k]); \
386 get_dirty(struct i830_hw_state
*state
)
388 return state
->active
& ~state
->emitted
;
392 get_state_size(struct i830_hw_state
*state
)
394 GLuint dirty
= get_dirty(state
);
398 if (dirty
& I830_UPLOAD_INVARIENT
)
399 sz
+= 40 * sizeof(int);
401 if (dirty
& I830_UPLOAD_CTX
)
402 sz
+= sizeof(state
->Ctx
);
404 if (dirty
& I830_UPLOAD_BUFFERS
)
405 sz
+= sizeof(state
->Buffer
);
407 if (dirty
& I830_UPLOAD_STIPPLE
)
408 sz
+= sizeof(state
->Stipple
);
410 for (i
= 0; i
< I830_TEX_UNITS
; i
++) {
411 if ((dirty
& I830_UPLOAD_TEX(i
)))
412 sz
+= sizeof(state
->Tex
[i
]);
414 if (dirty
& I830_UPLOAD_TEXBLEND(i
))
415 sz
+= state
->TexBlendWordsUsed
[i
] * 4;
422 /* Push the state into the sarea and/or texture memory.
425 i830_do_emit_state(struct intel_context
*intel
)
427 struct i830_context
*i830
= i830_context(&intel
->ctx
);
428 struct i830_hw_state
*state
= i830
->current
;
433 /* We don't hold the lock at this point, so want to make sure that
434 * there won't be a buffer wrap.
436 * It might be better to talk about explicit places where
437 * scheduling is allowed, rather than assume that it is whenever a
438 * batchbuffer fills up.
440 intel_batchbuffer_require_space(intel
->batch
, get_state_size(state
), 0);
442 /* Workaround. There are cases I haven't been able to track down
443 * where we aren't emitting a full state at the start of a new
444 * batchbuffer. This code spots that we are on a new batchbuffer
445 * and forces a full state emit no matter what.
447 * In the normal case state->emitted is already zero, this code is
448 * another set of checks to make sure it really is.
450 if (intel
->batch
->id
!= intel
->last_state_batch_id
||
451 intel
->batch
->map
== intel
->batch
->ptr
)
454 intel_batchbuffer_require_space(intel
->batch
, get_state_size(state
), 0);
457 /* Do this here as we may have flushed the batchbuffer above,
458 * causing more state to be dirty!
460 dirty
= get_dirty(state
);
461 state
->emitted
|= dirty
;
462 assert(get_dirty(state
) == 0);
464 if (intel
->batch
->id
!= intel
->last_state_batch_id
) {
465 assert(dirty
& I830_UPLOAD_CTX
);
466 intel
->last_state_batch_id
= intel
->batch
->id
;
469 if (dirty
& I830_UPLOAD_INVARIENT
) {
470 DBG("I830_UPLOAD_INVARIENT:\n");
471 i830_emit_invarient_state(intel
);
474 if (dirty
& I830_UPLOAD_CTX
) {
475 DBG("I830_UPLOAD_CTX:\n");
476 emit(i830
, state
->Ctx
, sizeof(state
->Ctx
));
480 if (dirty
& I830_UPLOAD_BUFFERS
) {
481 DBG("I830_UPLOAD_BUFFERS:\n");
482 BEGIN_BATCH(I830_DEST_SETUP_SIZE
+ 2, 0);
483 OUT_BATCH(state
->Buffer
[I830_DESTREG_CBUFADDR0
]);
484 OUT_BATCH(state
->Buffer
[I830_DESTREG_CBUFADDR1
]);
485 OUT_RELOC(state
->draw_region
->buffer
,
486 DRM_BO_FLAG_MEM_TT
| DRM_BO_FLAG_WRITE
,
487 state
->draw_region
->draw_offset
);
489 if (state
->depth_region
) {
490 OUT_BATCH(state
->Buffer
[I830_DESTREG_DBUFADDR0
]);
491 OUT_BATCH(state
->Buffer
[I830_DESTREG_DBUFADDR1
]);
492 OUT_RELOC(state
->depth_region
->buffer
,
493 DRM_BO_FLAG_MEM_TT
| DRM_BO_FLAG_WRITE
,
494 state
->depth_region
->draw_offset
);
497 OUT_BATCH(state
->Buffer
[I830_DESTREG_DV0
]);
498 OUT_BATCH(state
->Buffer
[I830_DESTREG_DV1
]);
499 OUT_BATCH(state
->Buffer
[I830_DESTREG_SENABLE
]);
500 OUT_BATCH(state
->Buffer
[I830_DESTREG_SR0
]);
501 OUT_BATCH(state
->Buffer
[I830_DESTREG_SR1
]);
502 OUT_BATCH(state
->Buffer
[I830_DESTREG_SR2
]);
506 if (dirty
& I830_UPLOAD_STIPPLE
) {
507 DBG("I830_UPLOAD_STIPPLE:\n");
508 emit(i830
, state
->Stipple
, sizeof(state
->Stipple
));
511 for (i
= 0; i
< I830_TEX_UNITS
; i
++) {
512 if ((dirty
& I830_UPLOAD_TEX(i
))) {
513 DBG("I830_UPLOAD_TEX(%d):\n", i
);
515 BEGIN_BATCH(I830_TEX_SETUP_SIZE
+ 1, 0);
516 OUT_BATCH(state
->Tex
[i
][I830_TEXREG_TM0LI
]);
518 if (state
->tex_buffer
[i
]) {
519 OUT_RELOC(state
->tex_buffer
[i
],
520 DRM_BO_FLAG_MEM_TT
| DRM_BO_FLAG_READ
,
521 state
->tex_offset
[i
] | TM0S0_USE_FENCE
);
523 else if (state
== &i830
->meta
) {
528 OUT_BATCH(state
->tex_offset
[i
]);
531 OUT_BATCH(state
->Tex
[i
][I830_TEXREG_TM0S1
]);
532 OUT_BATCH(state
->Tex
[i
][I830_TEXREG_TM0S2
]);
533 OUT_BATCH(state
->Tex
[i
][I830_TEXREG_TM0S3
]);
534 OUT_BATCH(state
->Tex
[i
][I830_TEXREG_TM0S4
]);
535 OUT_BATCH(state
->Tex
[i
][I830_TEXREG_MCS
]);
536 OUT_BATCH(state
->Tex
[i
][I830_TEXREG_CUBE
]);
539 if (dirty
& I830_UPLOAD_TEXBLEND(i
)) {
540 DBG("I830_UPLOAD_TEXBLEND(%d): %d words\n", i
,
541 state
->TexBlendWordsUsed
[i
]);
542 emit(i830
, state
->TexBlend
[i
], state
->TexBlendWordsUsed
[i
] * 4);
546 intel
->batch
->dirty_state
&= ~dirty
;
547 assert(get_dirty(state
) == 0);
551 i830_emit_state(struct intel_context
*intel
)
553 struct i830_context
*i830
= i830_context(&intel
->ctx
);
555 i830_do_emit_state( intel
);
557 /* Second chance - catch batchbuffer wrap in the middle of state
558 * emit. This shouldn't happen but it has been observed in
561 if (get_dirty( i830
->current
)) {
562 /* Force a full re-emit if this happens.
564 i830
->current
->emitted
= 0;
565 i830_do_emit_state( intel
);
568 assert(get_dirty(i830
->current
) == 0);
569 assert((intel
->batch
->dirty_state
& (1<<1)) == 0);
573 i830_destroy_context(struct intel_context
*intel
)
576 struct i830_context
*i830
= i830_context(&intel
->ctx
);
578 for (i
= 0; i
< I830_TEX_UNITS
; i
++) {
579 if (i830
->state
.tex_buffer
[i
] != NULL
) {
580 dri_bo_unreference(i830
->state
.tex_buffer
[i
]);
581 i830
->state
.tex_buffer
[i
] = NULL
;
585 _tnl_free_vertices(&intel
->ctx
);
590 i830_state_draw_region(struct intel_context
*intel
,
591 struct i830_hw_state
*state
,
592 struct intel_region
*color_region
,
593 struct intel_region
*depth_region
)
595 struct i830_context
*i830
= i830_context(&intel
->ctx
);
598 ASSERT(state
== &i830
->state
|| state
== &i830
->meta
);
600 if (state
->draw_region
!= color_region
) {
601 intel_region_release(&state
->draw_region
);
602 intel_region_reference(&state
->draw_region
, color_region
);
604 if (state
->depth_region
!= depth_region
) {
605 intel_region_release(&state
->depth_region
);
606 intel_region_reference(&state
->depth_region
, depth_region
);
610 * Set stride/cpp values
613 state
->Buffer
[I830_DESTREG_CBUFADDR0
] = _3DSTATE_BUF_INFO_CMD
;
614 state
->Buffer
[I830_DESTREG_CBUFADDR1
] =
615 (BUF_3D_ID_COLOR_BACK
|
616 BUF_3D_PITCH(color_region
->pitch
* color_region
->cpp
) |
621 state
->Buffer
[I830_DESTREG_DBUFADDR0
] = _3DSTATE_BUF_INFO_CMD
;
622 state
->Buffer
[I830_DESTREG_DBUFADDR1
] =
624 BUF_3D_PITCH(depth_region
->pitch
* depth_region
->cpp
) |
629 * Compute/set I830_DESTREG_DV1 value
631 value
= (DSTORG_HORT_BIAS(0x8) | /* .5 */
632 DSTORG_VERT_BIAS(0x8) | DEPTH_IS_Z
); /* .5 */
634 if (color_region
&& color_region
->cpp
== 4) {
640 if (depth_region
&& depth_region
->cpp
== 4) {
641 value
|= DEPTH_FRMT_24_FIXED_8_OTHER
;
644 value
|= DEPTH_FRMT_16_FIXED
;
646 state
->Buffer
[I830_DESTREG_DV1
] = value
;
648 I830_STATECHANGE(i830
, I830_UPLOAD_BUFFERS
);
655 i830_set_draw_region(struct intel_context
*intel
,
656 struct intel_region
*color_region
,
657 struct intel_region
*depth_region
)
659 struct i830_context
*i830
= i830_context(&intel
->ctx
);
660 i830_state_draw_region(intel
, &i830
->state
, color_region
, depth_region
);
665 i830_update_color_z_regions(intelContextPtr intel
,
666 const intelRegion
* colorRegion
,
667 const intelRegion
* depthRegion
)
669 i830ContextPtr i830
= I830_CONTEXT(intel
);
671 i830
->state
.Buffer
[I830_DESTREG_CBUFADDR1
] =
672 (BUF_3D_ID_COLOR_BACK
| BUF_3D_PITCH(colorRegion
->pitch
) |
674 i830
->state
.Buffer
[I830_DESTREG_CBUFADDR2
] = colorRegion
->offset
;
676 i830
->state
.Buffer
[I830_DESTREG_DBUFADDR1
] =
677 (BUF_3D_ID_DEPTH
| BUF_3D_PITCH(depthRegion
->pitch
) | BUF_3D_USE_FENCE
);
678 i830
->state
.Buffer
[I830_DESTREG_DBUFADDR2
] = depthRegion
->offset
;
683 /* This isn't really handled at the moment.
686 i830_lost_hardware(struct intel_context
*intel
)
688 struct i830_context
*i830
= i830_context(&intel
->ctx
);
689 i830
->state
.emitted
= 0;
697 return MI_FLUSH
| FLUSH_MAP_CACHE
;
702 i830_assert_not_dirty( struct intel_context
*intel
)
704 struct i830_context
*i830
= i830_context(&intel
->ctx
);
705 struct i830_hw_state
*state
= i830
->current
;
706 assert(!get_dirty(state
));
711 i830InitVtbl(struct i830_context
*i830
)
713 i830
->intel
.vtbl
.check_vertex_size
= i830_check_vertex_size
;
714 i830
->intel
.vtbl
.destroy
= i830_destroy_context
;
715 i830
->intel
.vtbl
.emit_state
= i830_emit_state
;
716 i830
->intel
.vtbl
.lost_hardware
= i830_lost_hardware
;
717 i830
->intel
.vtbl
.reduced_primitive_state
= i830_reduced_primitive_state
;
718 i830
->intel
.vtbl
.set_draw_region
= i830_set_draw_region
;
719 i830
->intel
.vtbl
.update_texture_state
= i830UpdateTextureState
;
720 i830
->intel
.vtbl
.flush_cmd
= i830_flush_cmd
;
721 i830
->intel
.vtbl
.render_start
= i830_render_start
;
722 i830
->intel
.vtbl
.render_prevalidate
= i830_render_prevalidate
;
723 i830
->intel
.vtbl
.assert_not_dirty
= i830_assert_not_dirty
;