_mesa_exec_free is still being called. More invasive refactoring is necessary to clean it out.
* Keith Whitwell <keithw@tungstengraphics.com>
*/
-#include "glheader.h"
-#include "context.h"
-#include "colormac.h"
#include "pipe/p_compiler.h"
+#include "pipe/p_util.h"
#include "draw_vf.h"
+
#define DBG 0
+/* TODO: remove this */
+extern void
+_mesa_exec_free( void *addr );
+
static boolean match_fastpath( struct draw_vertex_fetch *vf,
const struct draw_vf_fastpath *fp)
fastpath->match_strides = match_strides;
fastpath->func = vf->emit;
fastpath->attr = (struct draw_vf_attr_type *)
- _mesa_malloc(vf->attr_count * sizeof(fastpath->attr[0]));
+ MALLOC(vf->attr_count * sizeof(fastpath->attr[0]));
for (i = 0; i < vf->attr_count; i++) {
fastpath->attr[i].format = vf->attr[i].format;
unsigned offset = 0;
unsigned i, j;
- assert(nr < DRAW_VF_ATTRIB_MAX);
+ assert(nr < PIPE_ATTRIB_MAX);
memset(vf->lookup, 0, sizeof(vf->lookup));
-
+#if 0
/* Set attribute pointers, adjusted for start position:
*/
void draw_vf_set_sources( struct draw_vertex_fetch *vf,
a[j].inputptr = ((uint8_t *)vptr->data) + start * vptr->stride;
}
}
+#endif
/* Set attribute pointers, adjusted for start position:
struct draw_vertex_fetch *vf = CALLOC_STRUCT(draw_vertex_fetch);
unsigned i;
- for (i = 0; i < DRAW_VF_ATTRIB_MAX; i++)
+ for (i = 0; i < PIPE_ATTRIB_MAX; i++)
vf->attr[i].vf = vf;
vf->identity[0] = 0.0;
vf->codegen_emit = NULL;
#ifdef USE_SSE_ASM
- if (!_mesa_getenv("MESA_NO_CODEGEN"))
+ if (!GETENV("MESA_NO_CODEGEN"))
vf->codegen_emit = draw_vf_generate_sse_emit;
#endif
#define DRAW_VF_H
-#include "math/m_vector.h"
-
#include "pipe/p_compiler.h"
-#include "draw_vertex.h"
+#include "pipe/p_state.h"
+#include "draw_vertex.h"
-enum {
- DRAW_VF_ATTRIB_POS = 0,
- DRAW_VF_ATTRIB_WEIGHT = 1,
- DRAW_VF_ATTRIB_NORMAL = 2,
- DRAW_VF_ATTRIB_COLOR0 = 3,
- DRAW_VF_ATTRIB_COLOR1 = 4,
- DRAW_VF_ATTRIB_FOG = 5,
- DRAW_VF_ATTRIB_COLOR_INDEX = 6,
- DRAW_VF_ATTRIB_EDGEFLAG = 7,
- DRAW_VF_ATTRIB_TEX0 = 8,
- DRAW_VF_ATTRIB_TEX1 = 9,
- DRAW_VF_ATTRIB_TEX2 = 10,
- DRAW_VF_ATTRIB_TEX3 = 11,
- DRAW_VF_ATTRIB_TEX4 = 12,
- DRAW_VF_ATTRIB_TEX5 = 13,
- DRAW_VF_ATTRIB_TEX6 = 14,
- DRAW_VF_ATTRIB_TEX7 = 15,
- DRAW_VF_ATTRIB_VAR0 = 16,
- DRAW_VF_ATTRIB_VAR1 = 17,
- DRAW_VF_ATTRIB_VAR2 = 18,
- DRAW_VF_ATTRIB_VAR3 = 19,
- DRAW_VF_ATTRIB_VAR4 = 20,
- DRAW_VF_ATTRIB_VAR5 = 21,
- DRAW_VF_ATTRIB_VAR6 = 22,
- DRAW_VF_ATTRIB_VAR7 = 23,
- DRAW_VF_ATTRIB_POINTSIZE = 24,
- DRAW_VF_ATTRIB_BFC0 = 25,
- DRAW_VF_ATTRIB_BFC1 = 26,
- DRAW_VF_ATTRIB_CLIP_POS = 27,
- DRAW_VF_ATTRIB_VERTEX_HEADER = 28,
- DRAW_VF_ATTRIB_MAX = 29
-};
enum draw_vf_attr_format {
DRAW_EMIT_1F,
unsigned nr,
unsigned vertex_stride );
+#if 0
void
draw_vf_set_sources( struct draw_vertex_fetch *vf,
GLvector4f * const attrib[],
- unsigned start );
+ unsigned start );
+#endif
void
draw_vf_set_data( struct draw_vertex_fetch *vf,
unsigned count,
void *dest );
-void
-draw_vf_get_attr( struct draw_vertex_fetch *vf,
- const void *vertex,
- GLenum attr,
- const float *dflt,
- float *dest );
-
struct draw_vertex_fetch *
draw_vf_create( void );
struct draw_vertex_fetch
{
- struct draw_vf_attr attr[DRAW_VF_ATTRIB_MAX];
+ struct draw_vf_attr attr[PIPE_ATTRIB_MAX];
unsigned attr_count;
unsigned vertex_stride;
- struct draw_vf_attr *lookup[DRAW_VF_ATTRIB_MAX];
+ struct draw_vf_attr *lookup[PIPE_ATTRIB_MAX];
draw_vf_emit_func emit;
* Keith Whitwell <keithw@tungstengraphics.com>
*/
-#include "glheader.h"
-#include "context.h"
-#include "colormac.h"
+
+#include <assert.h>
+
#include "simple_list.h"
#include "pipe/p_compiler.h"
+#include "pipe/p_util.h"
#include "draw_vf.h"
static INLINE void insert_3f_xyw_err( const struct draw_vf_attr *a, uint8_t *v, const float *in )
{
(void) a; (void) v; (void) in;
- _mesa_exit(1);
+ assert(0);
}
static INLINE void insert_3f_3( const struct draw_vf_attr *a, uint8_t *v, const float *in )
* Keith Whitwell <keithw@tungstengraphics.com>
*/
-#include "glheader.h"
-#include "colormac.h"
+
#include "simple_list.h"
-#include "enums.h"
#include "pipe/p_compiler.h"
#include "draw_vf.h"
+
#if defined(USE_SSE_ASM)
#include "x86/rtasm/x86sse.h"
update_src_ptr(p, srcECX, vfESI, a);
}
else {
- _mesa_printf("Can't emit 1ub %x %x %d\n", a->vertoffset, a[-1].vertoffset, a[-1].vertattrsize );
+ fprintf(stderr, "Can't emit 1ub %x %x %d\n",
+ a->vertoffset, a[-1].vertoffset, a[-1].vertattrsize );
return FALSE;
}
break;
j++; /* NOTE: two attrs consumed */
}
else {
- _mesa_printf("Can't emit 3ub\n");
+ fprintf(stderr, "Can't emit 3ub\n");
}
return FALSE; /* add this later */
break;
update_src_ptr(p, srcECX, vfESI, a);
break;
default:
- _mesa_printf("unknown a[%d].format %d\n", j, a->format);
+ fprintf(stderr, "unknown a[%d].format %d\n", j, a->format);
return FALSE; /* catch any new opcodes */
}
return;
}
- _mesa_memset(&p, 0, sizeof(p));
+ memset(&p, 0, sizeof(p));
p.vf = vf;
p.inputs_safe = 0; /* for now */