Lines Matching refs:rmesa
69 rmesa->radeon.swtcl.vertex_attrs[rmesa->radeon.swtcl.vertex_attr_count].attrib = (ATTR); \
70 rmesa->radeon.swtcl.vertex_attrs[rmesa->radeon.swtcl.vertex_attr_count].format = (STYLE); \
71 rmesa->radeon.swtcl.vertex_attr_count++; \
77 rmesa->radeon.swtcl.vertex_attrs[rmesa->radeon.swtcl.vertex_attr_count].attrib = 0; \
78 rmesa->radeon.swtcl.vertex_attrs[rmesa->radeon.swtcl.vertex_attr_count].format = EMIT_PAD; \
79 rmesa->radeon.swtcl.vertex_attrs[rmesa->radeon.swtcl.vertex_attr_count].offset = (N); \
80 rmesa->radeon.swtcl.vertex_attr_count++; \
92 r100ContextPtr rmesa = R100_CONTEXT( ctx );
109 rmesa->radeon.swtcl.vertex_attr_count = 0;
114 if ( !rmesa->swtcl.needproj ||
127 rmesa->swtcl.coloroffset = offset;
137 rmesa->swtcl.specoffset = 0;
143 rmesa->swtcl.specoffset = offset;
168 rmesa->swtcl.specoffset = offset;
216 if (rmesa->radeon.tnl_index_bitset != index_bitset ||
217 fmt_0 != rmesa->swtcl.vertex_format) {
218 RADEON_NEWPRIM(rmesa);
219 rmesa->swtcl.vertex_format = fmt_0;
220 rmesa->radeon.swtcl.vertex_size =
222 rmesa->radeon.swtcl.vertex_attrs,
223 rmesa->radeon.swtcl.vertex_attr_count,
225 rmesa->radeon.swtcl.vertex_size /= 4;
226 rmesa->radeon.tnl_index_bitset = index_bitset;
228 "%s: vertex_size= %d floats\n", __FUNCTION__, rmesa->radeon.swtcl.vertex_size);
232 static void radeon_predict_emit_size( r100ContextPtr rmesa )
235 if (!rmesa->radeon.swtcl.emit_prediction) {
236 const int state_size = radeonCountStateEmitSize( &rmesa->radeon );
241 if (rcommonEnsureCmdBufSpace(&rmesa->radeon,
245 rmesa->radeon.swtcl.emit_prediction = radeonCountStateEmitSize( &rmesa->radeon );
247 rmesa->radeon.swtcl.emit_prediction = state_size;
248 rmesa->radeon.swtcl.emit_prediction += scissor_size + prims_size + vertex_size
249 + rmesa->radeon.cmdbuf.cs->cdw;
255 r100ContextPtr rmesa = R100_CONTEXT( ctx );
259 if (rmesa->radeon.dma.flush != 0 &&
260 rmesa->radeon.dma.flush != rcommon_flush_last_swtcl_prim)
261 rmesa->radeon.dma.flush( ctx );
272 r100ContextPtr rmesa = R100_CONTEXT( ctx );
275 GLuint se_coord_fmt = rmesa->hw.set.cmd[SET_SE_COORDFMT];
285 if (rmesa->radeon.Fallback != 0)
296 rmesa->swtcl.needproj = GL_TRUE;
301 rmesa->swtcl.needproj = GL_FALSE;
305 _tnl_need_projected_coords( ctx, rmesa->swtcl.needproj );
307 if ( se_coord_fmt != rmesa->hw.set.cmd[SET_SE_COORDFMT] ) {
308 RADEON_STATECHANGE( rmesa, set );
309 rmesa->hw.set.cmd[SET_SE_COORDFMT] = se_coord_fmt;
315 r100ContextPtr rmesa = R100_CONTEXT(ctx);
319 radeonEmitState(&rmesa->radeon);
320 radeonEmitVertexAOS( rmesa,
321 rmesa->radeon.swtcl.vertex_size,
322 rmesa->radeon.swtcl.bo,
326 radeonEmitVbufPrim( rmesa,
327 rmesa->swtcl.vertex_format,
328 rmesa->radeon.swtcl.hw_primitive,
329 rmesa->radeon.swtcl.numverts);
330 if ( rmesa->radeon.swtcl.emit_prediction < rmesa->radeon.cmdbuf.cs->cdw )
333 rmesa->radeon.cmdbuf.cs->cdw - rmesa->radeon.swtcl.emit_prediction );
336 rmesa->radeon.swtcl.emit_prediction = 0;
372 radeonDmaPrimitive( r100ContextPtr rmesa, GLenum prim )
374 RADEON_NEWPRIM( rmesa );
375 rmesa->radeon.swtcl.hw_primitive = hw_prim[prim];
376 // assert(rmesa->radeon.dma.current.ptr == rmesa->radeon.dma.current.start);
379 static void* radeon_alloc_verts( r100ContextPtr rmesa , GLuint nr, GLuint size )
383 radeon_predict_emit_size( rmesa );
384 rv = rcommonAllocDmaLowVerts( &rmesa->radeon, nr, size );
389 #define LOCAL_VARS r100ContextPtr rmesa = R100_CONTEXT(ctx)
390 #define INIT( prim ) radeonDmaPrimitive( rmesa, prim )
391 #define FLUSH() RADEON_NEWPRIM( rmesa )
393 // (((int)rmesa->radeon.dma.current.end - (int)rmesa->radeon.dma.current.ptr) / (rmesa->radeon.swtcl.vertex_size*4))
395 ((RADEON_BUFFER_SIZE) / (rmesa->radeon.swtcl.vertex_size*4))
396 #define ALLOC_VERTS( nr ) radeon_alloc_verts( rmesa, nr, rmesa->radeon.swtcl.vertex_size * 4 )
412 r100ContextPtr rmesa = R100_CONTEXT(ctx);
418 if (rmesa->radeon.swtcl.RenderIndex != 0 ||
422 radeon_prepare_render(&rmesa->radeon);
423 if (rmesa->radeon.NewGLState)
491 #define CTX_ARG r100ContextPtr rmesa
492 #define GET_VERTEX_DWORDS() rmesa->radeon.swtcl.vertex_size
493 #define ALLOC_VERTS( n, size ) radeon_alloc_verts( rmesa, n, (size) * 4 )
496 r100ContextPtr rmesa = R100_CONTEXT(ctx); \
497 const char *radeonverts = (char *)rmesa->radeon.swtcl.verts;
509 #define QUAD( a, b, c, d ) radeon_quad( rmesa, a, b, c, d )
510 #define TRI( a, b, c ) radeon_triangle( rmesa, a, b, c )
511 #define LINE( a, b ) radeon_line( rmesa, a, b )
512 #define POINT( a ) radeon_point( rmesa, a )
554 #define GET_VERTEX(e) (rmesa->radeon.swtcl.verts + ((e) * rmesa->radeon.swtcl.vertex_size * sizeof(int)))
600 r100ContextPtr rmesa = R100_CONTEXT(ctx); \
602 GLuint coloroffset = rmesa->swtcl.coloroffset; \
603 GLuint specoffset = rmesa->swtcl.specoffset; \
611 #define RENDER_PRIMITIVE rmesa->radeon.swtcl.render_primitive
654 radeon_point( rmesa, VERT(start) )
656 radeon_line( rmesa, VERT(v0), VERT(v1) )
658 radeon_triangle( rmesa, VERT(v0), VERT(v1), VERT(v2) )
660 radeon_quad( rmesa, VERT(v0), VERT(v1), VERT(v2), VERT(v3) )
667 r100ContextPtr rmesa = R100_CONTEXT(ctx); \
668 const GLuint vertsize = rmesa->radeon.swtcl.vertex_size; \
669 const char *radeonverts = (char *)rmesa->radeon.swtcl.verts; \
694 r100ContextPtr rmesa = R100_CONTEXT(ctx);
698 if (!rmesa->radeon.TclFallback || rmesa->radeon.Fallback)
704 if (index != rmesa->radeon.swtcl.RenderIndex) {
721 rmesa->radeon.swtcl.RenderIndex = index;
733 r100ContextPtr rmesa = R100_CONTEXT(ctx);
735 if (rmesa->radeon.swtcl.hw_primitive != hwprim) {
736 RADEON_NEWPRIM( rmesa );
737 rmesa->radeon.swtcl.hw_primitive = hwprim;
743 r100ContextPtr rmesa = R100_CONTEXT(ctx);
744 rmesa->radeon.swtcl.render_primitive = prim;
755 r100ContextPtr rmesa = R100_CONTEXT(ctx);
756 RADEON_STATECHANGE( rmesa, lin );
789 r100ContextPtr rmesa = R100_CONTEXT(ctx);
791 GLuint oldfallback = rmesa->radeon.Fallback;
794 rmesa->radeon.Fallback |= bit;
796 radeon_firevertices(&rmesa->radeon);
799 rmesa->radeon.swtcl.RenderIndex = ~0;
807 rmesa->radeon.Fallback &= ~bit;
820 if (rmesa->radeon.TclFallback) {
821 /* These are already done if rmesa->radeon.TclFallback goes to
827 rmesa->radeon.tnl_index_bitset = 0;
847 r100ContextPtr rmesa = R100_CONTEXT(ctx);
854 rmesa->radeon.swtcl.emit_prediction = 0;
867 rmesa->radeon.swtcl.verts = (GLubyte *)tnl->clipspace.vertex_buf;
868 rmesa->radeon.swtcl.RenderIndex = ~0;
869 rmesa->radeon.swtcl.render_primitive = GL_TRIANGLES;
870 rmesa->radeon.swtcl.hw_primitive = 0;