From 17ef840af40c9228ee0f4f7453bc00e318d9e6c4 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Tue, 29 Jan 2008 16:41:10 +0100 Subject: [PATCH] gallium: Fix build on WinXP. --- src/mesa/pipe/draw/draw_clip.c | 2 +- src/mesa/pipe/draw/draw_vertex_fetch.c | 16 ++++++++-------- src/mesa/pipe/draw/draw_vertex_shader.c | 4 ++-- src/mesa/pipe/draw/draw_vf.c | 10 ++++++---- src/mesa/pipe/draw/draw_vf_generic.c | 2 -- src/mesa/pipe/pipebuffer/pb_buffer_fenced.c | 4 ++-- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/mesa/pipe/draw/draw_clip.c b/src/mesa/pipe/draw/draw_clip.c index da20028904a..61130c5600a 100644 --- a/src/mesa/pipe/draw/draw_clip.c +++ b/src/mesa/pipe/draw/draw_clip.c @@ -406,7 +406,7 @@ clip_init_state( struct draw_stage *stage ) { struct clipper *clipper = clipper_stage( stage ); - clipper->flat = stage->draw->rasterizer->flatshade; + clipper->flat = stage->draw->rasterizer->flatshade ? TRUE : FALSE; if (clipper->flat) { const struct pipe_shader_state *vs = stage->draw->vertex_shader->state; diff --git a/src/mesa/pipe/draw/draw_vertex_fetch.c b/src/mesa/pipe/draw/draw_vertex_fetch.c index 89e4c256a7d..b23f487e741 100644 --- a/src/mesa/pipe/draw/draw_vertex_fetch.c +++ b/src/mesa/pipe/draw/draw_vertex_fetch.c @@ -326,6 +326,10 @@ static void fetch_xyz_rgb( struct draw_context *draw, const unsigned *elts, unsigned count ) { + const unsigned *pitch = draw->vertex_fetch.pitch; + const ubyte **src = draw->vertex_fetch.src_ptr; + int i; + assert(count <= 4); // _mesa_printf("%s\n", __FUNCTION__); @@ -333,10 +337,6 @@ static void fetch_xyz_rgb( struct draw_context *draw, /* loop over vertex attributes (vertex shader inputs) */ - const unsigned *pitch = draw->vertex_fetch.pitch; - const ubyte **src = draw->vertex_fetch.src_ptr; - int i; - for (i = 0; i < 4; i++) { { const float *in = (const float *)(src[0] + elts[i] * pitch[0]); @@ -366,15 +366,15 @@ static void fetch_xyz_rgb_st( struct draw_context *draw, const unsigned *elts, unsigned count ) { + const unsigned *pitch = draw->vertex_fetch.pitch; + const ubyte **src = draw->vertex_fetch.src_ptr; + int i; + assert(count <= 4); /* loop over vertex attributes (vertex shader inputs) */ - const unsigned *pitch = draw->vertex_fetch.pitch; - const ubyte **src = draw->vertex_fetch.src_ptr; - int i; - for (i = 0; i < 4; i++) { { const float *in = (const float *)(src[0] + elts[i] * pitch[0]); diff --git a/src/mesa/pipe/draw/draw_vertex_shader.c b/src/mesa/pipe/draw/draw_vertex_shader.c index 0806e23d6c4..b851da845f0 100644 --- a/src/mesa/pipe/draw/draw_vertex_shader.c +++ b/src/mesa/pipe/draw/draw_vertex_shader.c @@ -199,7 +199,7 @@ run_vertex_program(struct draw_context *draw, void draw_vertex_shader_queue_flush(struct draw_context *draw) { - unsigned i, j; + unsigned i; assert(draw->vs.queue_nr != 0); @@ -219,7 +219,7 @@ draw_vertex_shader_queue_flush(struct draw_context *draw) for (i = 0; i < draw->vs.queue_nr; i += 4) { struct vertex_header *dests[4]; unsigned elts[4]; - int n = MIN2(4, draw->vs.queue_nr - i); + int j, n = MIN2(4, draw->vs.queue_nr - i); for (j = 0; j < n; j++) { elts[j] = draw->vs.queue[i + j].elt; diff --git a/src/mesa/pipe/draw/draw_vf.c b/src/mesa/pipe/draw/draw_vf.c index 06b84b93cc8..0debea1f128 100644 --- a/src/mesa/pipe/draw/draw_vf.c +++ b/src/mesa/pipe/draw/draw_vf.c @@ -32,7 +32,7 @@ #include "draw_vf.h" -#define DBG 0 +#define DRAW_VF_DBG 0 /* TODO: remove this */ @@ -166,9 +166,10 @@ unsigned draw_vf_set_vertex_attributes( struct draw_vertex_fetch *vf, for (j = 0, i = 0; i < nr; i++) { const unsigned format = map[i].format; if (format == DRAW_EMIT_PAD) { - if (DBG) +#if (DRAW_VF_DBG) _mesa_printf("%d: pad %d, offset %d\n", i, map[i].offset, offset); +#endif offset += map[i].offset; @@ -186,10 +187,11 @@ unsigned draw_vf_set_vertex_attributes( struct draw_vertex_fetch *vf, if(vf->attr[j].isconst) memcpy(vf->attr[j].data, &map[i].data, vf->attr[j].vertattrsize); - if (DBG) +#if (DRAW_VF_DBG) _mesa_printf("%d: %s, offset %d\n", i, draw_vf_format_info[format].name, vf->attr[j].vertoffset); +#endif offset += draw_vf_format_info[format].attrsize; j++; @@ -303,7 +305,7 @@ void draw_vf_destroy( struct draw_vertex_fetch *vf ) * to unify them, but this probably won't change until this * module gets another overhaul. */ - _mesa_exec_free((void *) fp->func); + //_mesa_exec_free((void *) fp->func); FREE(fp); } diff --git a/src/mesa/pipe/draw/draw_vf_generic.c b/src/mesa/pipe/draw/draw_vf_generic.c index 0caa798396d..7f5f56ef9cc 100644 --- a/src/mesa/pipe/draw/draw_vf_generic.c +++ b/src/mesa/pipe/draw/draw_vf_generic.c @@ -29,8 +29,6 @@ #include -#include "simple_list.h" - #include "pipe/p_compiler.h" #include "pipe/p_util.h" diff --git a/src/mesa/pipe/pipebuffer/pb_buffer_fenced.c b/src/mesa/pipe/pipebuffer/pb_buffer_fenced.c index 349647fe6e4..4cf4222db9d 100644 --- a/src/mesa/pipe/pipebuffer/pb_buffer_fenced.c +++ b/src/mesa/pipe/pipebuffer/pb_buffer_fenced.c @@ -145,7 +145,7 @@ _fenced_buffer_list_check_free(struct fenced_buffer_list *fenced_list, /* Do the delayed destroy: */ pb_reference(&fenced_buf->buffer, NULL); - free(fenced_buf); + FREE(fenced_buf); } } @@ -162,7 +162,7 @@ fenced_buffer_destroy(struct pb_buffer *buf) } else { pb_reference(&fenced_buf->buffer, NULL); - free(fenced_buf); + FREE(fenced_buf); } if ((fenced_list->numDelayed % fenced_list->checkDelayed) == 0) -- 2.30.2